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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
alexpantex
Frequent Visitor

calculate ratio on some intermediate/filtered table

Hi everyone,

 

I have one doubt that I'm not currently able to solve.

Let's say that I have a following table imported:

CategoryManufacturerBrandSales
AM1B11
AM2B22
BM1B13
BM2B22

 

What I'd need is to calculate by Category if Manufacturer M1, for example, had greater sales than competition and calculate ratio in how manu categories it had greater sales.

For example, in Category A M1 had lower sales so I'd flag it as 0 and in Category B it had greater sales so I'd flag it as 1 and then the ratio would be 50%.

CategorySales_Flag
A0
B1

Not sure if there is a way to do this in one go, or is it possible to create intermediary table with DAX to look like this and then just use CALCULATE to create ratio?

 

Any help, hint or resource would be helpful.

 

Thanks

 

1 REPLY 1
lbendlin
Super User
Super User

That's a zero sum game unless you add the manufacturer to your output table.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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