Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, I want to be able to separate 2024 and 2025 active clients into their own measures, and have 2 lines on the graph for each year. Currently, it is a continuous graph like this
Here is the calculation that gets me the active clients. Some clients are active in multiple months/multiple times, and this gives me the accurate monthly figure, it was not as straightforward as a simple Count:
Solved! Go to Solution.
@RichOB To separate the active clients for 2024 and 2025 into their own measures and have two lines on the graph for each year, you can create two separate measures for each year.
DAX
Active Clients 2024 =
VAR CurrentMonthStart = MIN('Main_Calendar'[Date])
VAR CurrentMonthEnd = MAX('Main_Calendar'[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_date]), Table[End_Date] >= CurrentMonthStart),
YEAR('Main_Calendar'[Date]) = 2024
)
DAX
Active Clients 2025 =
VAR CurrentMonthStart = MIN('Main_Calendar'[Date])
VAR CurrentMonthEnd = MAX('Main_Calendar'[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_date]), Table[End_Date] >= CurrentMonthStart),
YEAR('Main_Calendar'[Date]) = 2025
)
Proud to be a Super User! |
|
@RichOB To separate the active clients for 2024 and 2025 into their own measures and have two lines on the graph for each year, you can create two separate measures for each year.
DAX
Active Clients 2024 =
VAR CurrentMonthStart = MIN('Main_Calendar'[Date])
VAR CurrentMonthEnd = MAX('Main_Calendar'[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_date]), Table[End_Date] >= CurrentMonthStart),
YEAR('Main_Calendar'[Date]) = 2024
)
DAX
Active Clients 2025 =
VAR CurrentMonthStart = MIN('Main_Calendar'[Date])
VAR CurrentMonthEnd = MAX('Main_Calendar'[Date])
RETURN
CALCULATE(
COUNTROWS(Table),
Table[Start_date] <= CurrentMonthEnd,
OR(ISBLANK(Table[End_date]), Table[End_Date] >= CurrentMonthStart),
YEAR('Main_Calendar'[Date]) = 2025
)
Proud to be a Super User! |
|
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
41 |
User | Count |
---|---|
108 | |
53 | |
50 | |
40 | |
40 |