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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.