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
Invisibleman
Helper II
Helper II

Need to get the highest selected month and year

Dear all,

 

For the report that I am creating, I have multiple charts. 1 should show only the value of the highest selected month & year, 1 should show the value of MTD, QTD or YTD, and 1 should show all values from start to the last date.

 

Now the MTD, QTD & YTD and all the astart to end is not an issue. But to get the values for only the selected year / month I don't get it to work.

 

I have 2 measures for the highest selected year and 1 for the highest selected month, which indeed are showing the correct value in the card. However, when I add those in the matrix, the highest selected month and the year, is not the actual highest selected month and the year. But the month and the year are basicly the year and month of the calendar, which are not the highest selected.

 

How can I make it so, that I am getting the actual highest selected year & month, so I can use those in the formula? The max isn't working and I also can't use the all or allselected.

 

As you can see in the sceenprint, in the matrix the highest selected month and year are not the same as in the card.

Examples.jpg

 

Please find here also the example power bi I have created; Test Power Bi 

 

Thanks in advance,

 

Regards,

Hans

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can use

_Highest Month = CALCULATE( MAX(mapCalendar[Month]), ALLSELECTED(MapCalendar) )

_Highest Selected Year = CALCULATE( MAX(mapcalendar[year]), ALLSELECTED(MapCalendar) )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You can use

_Highest Month = CALCULATE( MAX(mapCalendar[Month]), ALLSELECTED(MapCalendar) )

_Highest Selected Year = CALCULATE( MAX(mapcalendar[year]), ALLSELECTED(MapCalendar) )

Hello Johnt75,

 

Thank you very much, I was suffering for days to get this done. And I did use the max and did try with the allselected, but I didn't think about using the calculate, which surely does make sense.

 

Thanks again for the help, very appreciated.

 

Regards,

Hans

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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