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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Employee
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
Employee
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
Employee
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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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