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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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