cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Akbarov
Helper I
Helper I

Visualization to show Max value + category name

Hello Dear community,

 

Can anyone help me to with DAX measure which will return Max value from difference % column & it's category name.

And which visualization can I use which will show both?

 

In following example I want visualization to show : [Personal Service 166] or [Personal Service 437%]

 

Thank you. 

2022-05-23.png

2 ACCEPTED SOLUTIONS
dhruvinushah
Resolver IV
Resolver IV

Hi @Akbarov , 
You can use a Card Visual to show your requirement. 
I tested the steps below out in the Contoso Sample Power BI dataset on my machine.  They got me this result: 

dhruvinushah_2-1653266064449.png

 


1. Create a measure which would go something like this: 

Measure For Card Visual = 
VAR ABC = SUM(TableName[%DifferenceFromAmountField])

VAR BCD = MAXX(SUMMARIZE(TableName, CategoryName), ABC)

RETURN 
BCD

 

2. Add a card visual. Add the above created measure into the card visual. 

3. Go into the format settings of the Card Visual -> NAvigate to "General" -> Switch On Title settings -> Click the Fx button next to title heading (refer screenshot below): 

dhruvinushah_0-1653265856675.png

4. Now choose the Category field as in the Fx conditional formatting field. 

dhruvinushah_1-1653265922227.png


5. Click Ok.

Your card will show you the MAX Value of your field and the title will show the category that the MAX value belongs to. 

Hope this helps. Please give a thumbs up if it does 🙂

Also, to understand the idea behind the calculation you can refer to this video -
https://youtu.be/UJPBeiGBEg4

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Trythese measures

Max difference %  = MAXX(all(data[category]),[difference %])

Category of max difference % = FIRSTNONBLANK(TOPN(1,VALUES(Products[Category]),[difference %]),1)

Drag both measures to a multi card visual.  If these measures do not work, then share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Akbarov
Helper I
Helper I

Thanks both for answers,  my values ( % ) mostly negative values, I used ABS() now results are correct.

Ashish_Mathur
Super User
Super User

Hi,

Trythese measures

Max difference %  = MAXX(all(data[category]),[difference %])

Category of max difference % = FIRSTNONBLANK(TOPN(1,VALUES(Products[Category]),[difference %]),1)

Drag both measures to a multi card visual.  If these measures do not work, then share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
dhruvinushah
Resolver IV
Resolver IV

Hi @Akbarov , 
You can use a Card Visual to show your requirement. 
I tested the steps below out in the Contoso Sample Power BI dataset on my machine.  They got me this result: 

dhruvinushah_2-1653266064449.png

 


1. Create a measure which would go something like this: 

Measure For Card Visual = 
VAR ABC = SUM(TableName[%DifferenceFromAmountField])

VAR BCD = MAXX(SUMMARIZE(TableName, CategoryName), ABC)

RETURN 
BCD

 

2. Add a card visual. Add the above created measure into the card visual. 

3. Go into the format settings of the Card Visual -> NAvigate to "General" -> Switch On Title settings -> Click the Fx button next to title heading (refer screenshot below): 

dhruvinushah_0-1653265856675.png

4. Now choose the Category field as in the Fx conditional formatting field. 

dhruvinushah_1-1653265922227.png


5. Click Ok.

Your card will show you the MAX Value of your field and the title will show the category that the MAX value belongs to. 

Hope this helps. Please give a thumbs up if it does 🙂

Also, to understand the idea behind the calculation you can refer to this video -
https://youtu.be/UJPBeiGBEg4

 

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors