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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
doubleclick
Resolver I
Resolver I

Create measure to calculate the max of another measure within Date Range

Hello all,

I have a measure that calulcates the number of leavers depending on the calendar table date.

 

 

Net Finishers:=CALCULATE (
    DISTINCTCOUNT ( 'FACT_EDE'[Worker] ),
    FILTER (
        'FACT_EDE',
        'FACT_EDE'[End Date] <= MAX ( 'Calendar'[Date] )
            && 'FACT_EDE'[End Date] >= MIN ( 'Calendar'[Date] )
    )
)

 

 

 

I have another measure to show me todays date :

 

 

 

Today:=IF(MIN('Calendar'[Date]) <= TODAY() && MAX('Calendar'[Date]) >= TODAY(), 60)

 

 

 

That 60 at the end, i want that to be the max of the finishers within the calendar date range. This is so i have have the number of leavers going forward into the future and a signle bar that will go to the top of the graph by the maximum number of leavers in the graph. 

 

Can anyone figure this out?

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

@doubleclick  say you have Year/Month series on the x axis, then create a measure like this

MaxFinishersToDate=IF(MIN('Calendar'[Date]) <= TODAY() && MAX('Calendar'[Date]) >= TODAY(), MAXX(FILTER(ALL('Calendar'[Year/Month]),[Net Finishers]))

View solution in original post

3 REPLIES 3
wdx223_Daniel
Super User
Super User

@doubleclick  say you have Year/Month series on the x axis, then create a measure like this

MaxFinishersToDate=IF(MIN('Calendar'[Date]) <= TODAY() && MAX('Calendar'[Date]) >= TODAY(), MAXX(FILTER(ALL('Calendar'[Year/Month]),[Net Finishers]))

It worked with some minor adjustments!! Thank you so much you legend!!! 

 

MaxFinishersToDate:=IF(MIN('Calendar'[Date]) <= TODAY() && MAX('Calendar'[Date]) >= TODAY(), MAXX(FILTER(ALL('Calendar'[Date]),[Net Finishers]),[Net Finishers]))

edhans
Super User
Super User

You are going to have to provide data and expected results @doubleclick . You cannot have one measure determine the MAX of another measure, because a measure always only returns one value. It may be calculated multiple times within a visual, but the value of a measure is what you drop into a card. The reason it shows other values in a chart, table, etc. is the filter context changes it (days, customers, vendors, etc.)

 

So to do what you want, you'd need a new measure that calcaulted the max of a table of data. But we'd need data (per links below) and sample output.

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Kudoed Authors