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
RandyR1963
Frequent Visitor

DAX Formula for SumProduct as is in Excel

Hi All, 

Looking for help to find the percentage of a total based on the sum of a class. 

For instance, this would be simular to the SumProduct that Excel uses .. which in my search is supposed to be SUMX in DAX, but i have yet to find a resonable fix is achieving this. 

 

Example Excel Code > =(SUMPRODUCT(($D$2:$D$107=D2)*(J2>=$J$2:$J$107)))/COUNTIF($D$2:$D$107,D2)

this formula retuns the percetage .  

How can i achieve this using DAX is PowerBI

 

I have 9 Classifications in all, 

i want to sum the Revenue of those individual Classifications, Divide the Total sum of those Classifications bu the lines Revenue to achieve the percentage tha tparticular line is to the total of all classifications,. 

 

I have used the below DAX Code in my PBI, but i don't get the same results as the same data using the SumProduct in Excel. 

I got this from a pose here > https://community.powerbi.com/t5/Desktop/Percentage-of-category-and-subcategory-agints-a-specific/m-...

 

Gross REV Rank = DIVIDE(SUM('Year REV-COGs Template xlsx_SharePoint'[Rev ]), CALCULATE(sum('Year REV-COGs Template xlsx_https://clearesult5 sharepoint com/sites/South-C (2)'[Rev ]), FILTER(ALL('Year REV-COGs Template xlsx_https://SharePoint-C (2)'), 'Year REV-COGs Template xlsx_https://SharePoint-C (2)'[Classification] = "C&I Solutions")))
 
The above seems to be using only using one classification as it is defined in the formula.. 
 
Ny Table Heaaders are 
Classification    Revenue
Class 1              100.00
Class 1               200.00
Class 2               500.00
Any help greatly apprciated 
 
RandyR1963
 

 

 

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

Have you looked at in the Values area of the Visualization pane using the drop down for the field and choosing Show As and then Percent of Grand Total?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thank you for the information, 

Using that doesn't give me the percentage of the Sum of Revenue per Classification, which is what i am looking for in a table . 

 

There are 9 total Classifications and 106 Rows of Program Names and each has a Revenue Cell, 

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.