cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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

Accepted Solutions
Phil_Seamark Super Contributor
Super Contributor

Re: Calculating Measure

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
DoubleJ Member
Member

Re: Calculating Measure

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

 

Phil_Seamark Super Contributor
Super Contributor

Re: Calculating Measure

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

Highlighted
v-huizhn-msft Super Contributor
Super Contributor

Re: Calculating Measure

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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 174 members 2,092 guests
Please welcome our newest community members: