Forum Discussion
joaodd
2 years agoFrequent Visitor
How to include a dinamic variable into a temporary column
I have a table "REGISTRATION" with 3 fields: - StudentNumber - Date - Status This table registers any change in the student status, each time the student status changes it is registered in this ...
joaodd
2 years agoFrequent Visitor
Please find a sample data: https://transfer-vinci-energies.netexplorer.pro/fdl/eSj2RoLNz_SPHwUux61wQwModc54Vv
Please note that I don't want to create a calculated table, but rather a measure that can count how many active students are present on any date selected by the user using a slicer. So i'm considering this temporary table inside a measure, something like this:
Active Students =
VAR
Active Registrations = SUMMARIZECOLUMNS(
'REGISTRATION'[StudentNumber],
FILTER('REGISTRATION', 'REGISTRATION'[Date] < selectedvalue('Calendar'[Date]),
"MostRecentDate",
MAXX(
TOPN(
1,
filter('REGISTRATION','REGISTRATION'[Date] <= selectedvalue('Calendar'[Date])),
'REGISTRATION'[Date],
DESC
),
'REGISTRATION'[Date]
),
"MostRecentStatus",
MAXX(
TOPN(
1,
filter('REGISTRATION','REGISTRATION'[Date] <= selectedvalue('Calendar'[Date])),
'REGISTRATION'[Date],
DESC
),
'REGISTRATION'[Status]
))
RETURN Countrows(summarizecolumns('Active Registrations',filter('Active Registrations'[Status] = "ACTIVE])))
joaodd
2 years agoFrequent Visitor
Here's the link: https://transfer-vinci-energies.netexplorer.pro/dl/RY8c3ksKxYBsqMupb3xxHTSvLBulUP
I tried your suggestion but PowerBI retrieves the following error:
"It's not possible to find the table Active Registrations".