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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
heberpower
Frequent Visitor

Return 1 row per month depending on the MAX per month of a column.

My data set looks like this:

 

data_set.jpg

 

This is my desired results but I have been struggling with this for weeks now.  Any help is appreciated!

 

I need to retrieve 1 row for each month where the "Peak" is the MAX during that month.  Like this:

 

Desired Results:

desired_results.jpg

1 ACCEPTED SOLUTION
Shishir22
Solution Sage
Solution Sage

Hello @heberpower ,

 

Create below measure and use Measure = 1 as a visual level filter.

 

MeasureFlag = 
var _Month= SELECTEDVALUE(DimDate[Month])
var _Year= SELECTEDVALUE(DimDate[Year])
Return
if(MAX(PeakTable[Peak])=CALCULATE(MAX(PeakTable[Peak]),FILTER(ALL(DimDate),DimDate[Month]=_Month && DimDate[Year]=_Year)),1,BLANK())

 

Screenshot:

peak.PNG

 

If this fulfils your requirement please mark it as a solution. Kudos are also welcomed!

 

Thanks!

Cheers,
Shishir

View solution in original post

2 REPLIES 2
Shishir22
Solution Sage
Solution Sage

Hello @heberpower ,

 

Create below measure and use Measure = 1 as a visual level filter.

 

MeasureFlag = 
var _Month= SELECTEDVALUE(DimDate[Month])
var _Year= SELECTEDVALUE(DimDate[Year])
Return
if(MAX(PeakTable[Peak])=CALCULATE(MAX(PeakTable[Peak]),FILTER(ALL(DimDate),DimDate[Month]=_Month && DimDate[Year]=_Year)),1,BLANK())

 

Screenshot:

peak.PNG

 

If this fulfils your requirement please mark it as a solution. Kudos are also welcomed!

 

Thanks!

Cheers,
Shishir

Worked like a charm!  Thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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