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
Anonymous
Not applicable

Calculate cumulative % in Table

Hi,
I have requirement. to calcualte cummalative % and to Show Total Liters in table chart. i tried using dax measure but it is not giving correct result. Please help
i need calculate % Running total - Example IT60 - it should give 18%
US 21 - 18%+13% = 31%
PE10 = 18%+13%+10%= 41% and so on
i have tried by using Quick Measure - Running total as below screenshot and it is not giving Proper result 


Note - Total Liters is sorted as Descending order

LikhithaVG123_0-1678201479369.png

Thanks

 

5 REPLIES 5
andhiii079845
Super User
Super User

From which table is "receiving plant"? I think this is the problem. please share the underlaying datamodel and tables.

You also say now "Total litre measure". You do not mentioned it before that is is a measure. Please share the measure.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @andhiii079845 
Total Liters and % are measures, and need to calculate Cummalative % (To show Total Liters as highest to lowest in table chart)

Total liters = 

CALCULATE( sumx(
 tbl_cses_salesordertransit_rpt, tbl_cses_salesordertransit_rpt[Liters/Case] * tbl_cses_salesordertransit_rpt[OrderQuantity])

% =DIVIDE(sum(tbl_cses_salesordertransit_rpt[Total Liters FG]),[Sum of Total Litres FG])

LikhithaVG123_0-1678275267146.png

Thanks

Can you please give a full example of all involved tables, the relation and with some data examples. It is for me not clear in the moment where the problem is. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




andhiii079845
Super User
Super User

Hi,

try this. Change the table name which I used. 

running total % = 

 VAR _currentlilter = maxx(table2,table2[Total liters])
 VAR _total = sumx(ALLSELECTED(table2),table2[Total liters])
 VAR _currenttotal = sumx(FILTER(ALLSELECTED(table2),table2[Total liters]<=_currentlilter),table2[Total liters])

 RETURN _currenttotal/_total
 
andhiii079845_0-1678218403689.png

Mark my post as a solution if it was helpfull.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @andhiii079845 
I have tried your solution in calculated column but it is giving result as 100% for all values. Please help on this

calculated column - running total % colum =


 VAR _currentlilter = maxx(tbl_cses_salesordertransit_rpt,tbl_cses_salesordertransit_rpt[Total Liters FG])
 VAR _total = sumx(ALLSELECTED(tbl_cses_salesordertransit_rpt),tbl_cses_salesordertransit_rpt[Total Liters FG])
 VAR _currenttotal = sumx(FILTER(ALLSELECTED(tbl_cses_salesordertransit_rpt),tbl_cses_salesordertransit_rpt[Total Liters FG]<=_currentlilter),tbl_cses_salesordertransit_rpt[Total Liters FG])

 RETURN _currenttotal/_total
 
LikhithaVG123_1-1678274379199.png

Thanks

 

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.

Top Solution Authors