Forum Discussion
Mmerinen
2 years agoNew Member
Remove Matrix context from a user count measure
Hi, new to PowerBi and looking for a solution to remove Matrix context from a measure. I am creating a matrix showcasing revenue in time per product. Some product have a price per user, and others...
Mmerinen
2 years agoNew Member
For the dynamic user count, the DAX below almost works, but it is not taking into account the overriding of slicer context for dates (shown in bold cursive)
Dynamic User Count =
VAR currentdate = MAX('MRR Calendar'[Date])
VAR currentcompany = SELECTEDVALUE('MRR Clients'[company_id])
RETURN
CALCULATE(
DISTINCTCOUNT('MRR Clients'[user_id]),
FILTER(
ALLSELECTED('MRR Calendar'[Date]),
ISONORAFTER('MRR Calendar'[Date], currentdate, DESC)),
ALLEXCEPT('MRR Clients', 'MRR Clients'[user_id]),
'MRR Clients'[company_id] = currentcompany,
'MRR Clients'[user_createdat] <= currentdate, // User created on or before the selected date
('MRR Clients'[user_deletedat] > currentdate || ISBLANK('MRR Clients'[user_deletedat])), // User deleted after or on the selected date
'MRR Clients'[company_billing_startdate] <= currentdate
)