Hi All,
I have tried to find the right DAX calculation to solve this problem without success, so I need your expertise to find the right solution. The question I want to solve is "How many unique UIDs that are repeat offenders (Column ‘Offender’ > 0) and a count of reps appearing in appearing in more than 1 (of the selected) months?
Can you please upload the working of the file for the reference? So that members of our forum can assist you better and provide you results efficiently.
This was a bit trickier than it looked at first glance. See if this works for you:
MonthCount =
CALCULATE(
DISTINCTCOUNT( Data[YYYYMM] ),
ALLEXCEPT( Data, Data[UID] )
)
Summary Offenders =
VAR vTable0 = CALCULATETABLE(
Data,
Data[Offender] > 0
)
VAR Vtable1 = ADDCOLUMNS(
SUMMARIZE( vTable0, Data[Channel], Data[UID] ),
"@monthcount", [MonthCount]
)
VAR vTable2 = FILTER( Vtable1, [@monthcount] > 1 )
VAR Result = COUNTROWS( vTable2 )
RETURN
Result
The one question I had is that UID 20 seems like it should be included based on your criteria. Please let me know if I’ve interpreted that incorrectly.
I hope this is helpful. Full solution file attached below.
Thank you Brian! yes the 20 was not included because the offender column is 0 in 202006 and in 202007 the offender column is 5. It needs to be repeat offenders appearing in more than 1 month.
@mmurillo7gt Similarly 15 shouldn’t be included? Can you spend some time in checking what exactly should be included. It will help us in providing a solution quickly.
It’s great to know that you are making progress with your query @mmurillo7gt. Please don’t forget if your question has been answered within the forum it is important to mark your thread as ‘solved’. Also, we’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!
I got you covered. I’ve already marked it, but for future reference just go to the post that solved the issue, click on the three dots and then click on the solved box per the screenshot below.