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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
aktripathi2506
Helper IV
Helper IV

Calculating Measure

Hi,

 

I have this following situation where I want to calculate = Sum of (product sale by group)/Sum of Total product in Group

 

From this data, desired output is: = (599/2332) = 0.25

 

Thanks in Advance

 

ProductGroupProduct sale by GroupTotal product in group
P1G178122
P1G22448
P1G31876
P1G449160
P2G139123
P2G2641
P2G31957
P2G455152
P3G139139
P3G2731
P3G3571
P3G417132
P4G118122
P4G23047
P4G31361
P4G49115
P5G18122
P5G21649
P5G32115
P5G440123
P6G11495
P6G22666
P6G39121
P6G458144
1 ACCEPTED SOLUTION
Phil_Seamark
Microsoft Employee
Microsoft Employee

This will give you the result you say you want, regardless of what/where you filter.  Not sure if that is what you are after though

 

New Measure = DIVIDE(
                    CALCULATE(
                        SUM(Table1[Product sale by Group]),
                        ALL('Table1')
                        )
                       ,                    CALCULATE(
                        SUM(Table1[Total product in group]),
                        ALL('Table1')
                        )
					)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @aktripathi2506,

As the @Phil_Seamark posted, create a measure using the formula and create a card to display the expected result as follows.

12.PNG

If you have resolved your issue, please mark the right reply as answer, if it doesn't, please feel free to ask.

Best Regards,
Angelia

Phil_Seamark
Microsoft Employee
Microsoft Employee

This will give you the result you say you want, regardless of what/where you filter.  Not sure if that is what you are after though

 

New Measure = DIVIDE(
                    CALCULATE(
                        SUM(Table1[Product sale by Group]),
                        ALL('Table1')
                        )
                       ,                    CALCULATE(
                        SUM(Table1[Total product in group]),
                        ALL('Table1')
                        )
					)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

DoubleJ
Solution Supplier
Solution Supplier

Hi

 

Not sure if I got you right. The formula of your measure would be:

 

=DIVIDE(
     SUM(product sale by group),
     SUM(Total product in Group),
     0)
    

Hope this helps

JJ

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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