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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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