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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Find Max value of a measure by column header in matrix visual

Hi There,

I have a matrix visual that displays the WoW change (a measure) per marker selected as the column header (MarkerTable) by Year&Week (Date Table).  I want to identify the max WOWChange in each column of the visual.

 

These are the basic measures...I'm really using a bunch of SWITCH() for Currency/Unit conversion. 

 

AveragePrice =

AVERAGEX(
    KEEPFILTERS(VALUES(Date[Date Time])),
    CALCULATE(SUM(MarkerPrice_AllDates[Dollar/Unit_CAD]))
)
 
PW_AveragePrice=
Var CurrentWeek = SELECTEDVALUE(Date[WeekNumber])
Var CurrentYear = SELECTEDVALUE(Date[Year])
Var MaxWeekNumber=Calculate(MAX(Date[WeekNumber]),ALL(Date))

RETURN
AVERAGEX(FILTER( ALL(Date),
    IF(CurrentWeek = 1,
        Date[WeekNumber] = MaxWeekNumber && Date[Year] = CurrentYear -1,
        Date[WeekNumber] = CurrentWeek-1 && 'ate[Year] = CurrentYear)), [AveragePrice])
 
WoWChange =
AveragePrice-PW_AveragePrice
 
WoWChangeMAX??
 
Capture.PNG
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I got it!  I was using the wrong date increment...silly me...

 

I used this measure in the conditional formatting as the field value.  Pretty in pink!

 

WoWChangeMax =
VAR MaxChange =
    MAXX ( ALLSELECTED ( 'Date'[Year & Week] ), [WoWChange] )
RETURN
    SWITCH(TRUE(), [WoWChange] = MaxChange, "#E61576"  )

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@Anonymous can you try this measure

 

Max Avg = 
MAXX ( ALL ( Table[Year and Week] ), [Your Measure] )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I got it!  I was using the wrong date increment...silly me...

 

I used this measure in the conditional formatting as the field value.  Pretty in pink!

 

WoWChangeMax =
VAR MaxChange =
    MAXX ( ALLSELECTED ( 'Date'[Year & Week] ), [WoWChange] )
RETURN
    SWITCH(TRUE(), [WoWChange] = MaxChange, "#E61576"  )

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.