cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

How to show MAX compared to Others using DAX

Assume I have two tables:

 

1. DimSupplier

 

supplier.PNG

 

2. FactInvoice

 

FactInvoice.PNG

 

Now I would like to show the marketshare of the biggest/max supplier (based on SUM of Spend) compared to others. (If no filter, supplier 1 is the biggest supplier with total spend 290)

 

MaxSpend.png

 

How I can do in DAX? The biggest suppliers will be changed based on the filter from users.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: How to show MAX compared to Others using DAX

I would use a Card visualization for that and put Supplier in there. Then, set a Top N filter (1) on that bad boy (Supplier) with a value of the Sum of Spend.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
Highlighted
Advocate II
Advocate II

Create Table based on GROUP BY

Assume I have 2 two tables:

 

1. DimSupplier

 

supplier.PNG

 

2. FactInvoice

 

FactInvoice.PNG

 

I tried to create New Table based on Group By with the code:

 


New Table = GROUPBY(FactInvoice, DimSupplier[Name],
"TotalSpend", SUMX(CURRENTGROUP(), FactInvoice[Spend]))

The new table after creating:

 

New Table.PNG

 

But this new table is not dynamically filtered when user do filtering using slicer. So assume if only Supplier 1 and Supplier 2 are choosen. The table should only show data for Supplier 1 and Supplier 2.

 

Is this possible?

Highlighted
Super User IV
Super User IV

Re: Create Table based on GROUP BY

You shouldn't need to create a table, just create a table visualization and put Supplier from DimSupplier into it as well as Spend with a SUM aggregation.

 

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Advocate II
Advocate II

Re: Create Table based on GROUP BY

I have posted my real problem in here:

 

https://community.powerbi.com/t5/Desktop/How-to-show-MAX-compared-to-Others/m-p/174881#M76420

 

My initial purpose is to create `table measure` in order to solve the above problem

Highlighted
Super User IV
Super User IV

Re: How to show MAX compared to Others using DAX

Create this measure:

 

Top Supplier = MAXX(SUMMARIZE(Suppliers,Suppliers[Supplier],"MySpend",SUM([Spend])),[MySpend])

Then create this measure:

 

Others = SUM(Suppliers[Spend]) - [Top Supplier]

Add these two measurs as values in your pie chart visualization.

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Super User IV
Super User IV

Re: Create Table based on GROUP BY

Got it, I just answered that one!!


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Advocate II
Advocate II

Re: How to show MAX compared to Others using DAX

Thanks @Greg_Deckler, is there anyway that the name of biggest supplier can show up in the pie chart
Highlighted
Super User IV
Super User IV

Re: How to show MAX compared to Others using DAX

I would use a Card visualization for that and put Supplier in there. Then, set a Top N filter (1) on that bad boy (Supplier) with a value of the Sum of Spend.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors