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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fdavef
Helper III
Helper III

Sums calculation

Table is 

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

City                   Store     Product             Price

Toronto              A             TV1                 500

Toronto              B             TV2                  550

Ottawa               C             Laptop1          600

Ottawa               D             Laptop2          650

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

 

I want to display like

 

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

City                   Store     Product             Price               ratio

Toronto              A             TV1                  500             500/1050

Toronto              B             TV2                  550             550/1050

Ottawa               C             Laptop1           600              600/1250

Ottawa               D             Laptop2           650              650/1250

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

 

How to create a new measure ratio to display the above picture?

 

 

 

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@fdavef ,

You can create 2 Calculated Columns:

TotalPrice = CALCULATE( SUM( [Price] ),
                ALLEXCEPT(YourTable, YourTable[City] ))

Ratio = [Price] & "/" & [TotalPrice]

rsbin_0-1698089853722.png

Hope this is what you are looking for.

Regards,

View solution in original post

2 REPLIES 2
rsbin
Super User
Super User

@fdavef ,

You can create 2 Calculated Columns:

TotalPrice = CALCULATE( SUM( [Price] ),
                ALLEXCEPT(YourTable, YourTable[City] ))

Ratio = [Price] & "/" & [TotalPrice]

rsbin_0-1698089853722.png

Hope this is what you are looking for.

Regards,

@rsbin , Thank you for your help. 

 ALLEXCEPT(YourTable, YourTable[City] )

means only use city filter.

 

I have a further question. I will post it in this forum.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.