Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
RichOB
Post Partisan
Post Partisan

Need help wrapping a date around a measure

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

 

Client.png

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:

 

Active Clients =
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)
)
 
Thanks!

 

 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
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
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
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
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.