cuongle
cuongle

Reputation: 75316

Power BI Marketshare with DAX

I got really stumped for my whole day on how to display marketshare on Power BI. My data is kind of complicated but I will try to simplify the problem in here, assume I have two tables:

  1. Dimension Supplier:

enter image description here

  1. FactInvoice:

enter image description here

I would like to display the marketshare (Sum of Spend) for one specific supplier compared to others, with slicer and pie char like this:

enter image description here So if user choose Supplier 2, the pie chart will show the marketshare of supplier 2 compared to others. I am not sure how DAX can support this

If the Pie chart is not possible, is there any way to show this concept on the Power BI, it does not matter which visual we can use?

Upvotes: 1

Views: 1678

Answers (2)

Kunwar Maurya
Kunwar Maurya

Reputation: 76

First: calculate % each company spend to total company using formula:

Company/total Spend Percentage = DIVIDE([Company Spend],[AllCompany Spend],0)

Second: Subtract each company from total % i.e.= 1

Other company Spend% = 1-[Company/total Spend Percentage]

Put both measure in Pie Chart.

Upvotes: 0

sanjay kumar
sanjay kumar

Reputation: 316

Step 1 create data model like below image enter image description here

Step 2: create two measures Other Supplier = CALCULATE(SUM(FactInvoice[Spend]),FILTER(FactInvoice,FactInvoice[SupplierID]<>MAX(SupplierDup[ID])))

Selected Supplier = CALCULATE(SUM(FactInvoice[Spend]),FILTER(FactInvoice,FactInvoice[SupplierID]=MAX(SupplierDup[ID])))

Create your report( if you not select any supplier then comparison will be in between max id of supplier to others)

your report

download PowerBI file

enter image description here

Upvotes: 2

Related Questions