Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to display a number of active users for a given month and year in a line chart. My data file got Year, User ID and exit date. I want to display number of active users for each department in a graph. Users who are still active, wont have any value under Exit date field. Please note that same user can appear in multiple years
Sample data file
Year, User ID, Department, Exit Date
2018, 1010, ABC
2019, 1010, ABC, 31/01/2019 12:00:00 AM
2018, 2314, ABC,
2018, 5455, ABC, 23/12/2018 12:00:00 AM
2018, 7676, XYZ
2019, 7676, XYZ, 6/03/2019 10:10:00 PM
2019, 6556, XYZ,
2019, 6767, ABC
Thanks.
Solved! Go to Solution.
HI @MatE ,
You can add department filter to dax formula:
Measure = VAR currDate = MAX ( Calendar[date] ) RETURN CALCULATE ( COUNTROWS ( Table ), FILTER ( ALLSELECTED ( Table ), [Year] <= YEAR ( currDate ) && OR ( [Exit Date] <= currDate, [Exit Date] = BLANK () ) ), VALUES ( Table[Department] ) )
Regards,
Xiaoxin Sheng
Hi @MatE ,
I'd like to suggest you to create a unrelated calendar table, then write a measure to use current calendar date to filter on sample table records.
Measure = VAR currDate = MAX ( Calendar[date] ) RETURN CALCULATE ( COUNTROWS ( Table ), FILTER ( ALLSELECTED ( Table ), [Year] <= YEAR ( currDate ) && OR ( [Exit Date] <= currDate, [Exit Date] = BLANK () ) ) )
Regards,
Xiaoxin Sheng
Thanks for the reply. How can I group that value by the department?
HI @MatE ,
You can add department filter to dax formula:
Measure = VAR currDate = MAX ( Calendar[date] ) RETURN CALCULATE ( COUNTROWS ( Table ), FILTER ( ALLSELECTED ( Table ), [Year] <= YEAR ( currDate ) && OR ( [Exit Date] <= currDate, [Exit Date] = BLANK () ) ), VALUES ( Table[Department] ) )
Regards,
Xiaoxin Sheng
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |