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.
Dear Experts
I would like to achieve the below "% Contribution (reverse)" and "Cumulative" based on the value in my previous column. These 2 columns should be dynamic (meaning, if I remove "Prod C" from the report the columns should adjust calculations accordingly.
Please advise how to achieve this.
Thanks in advance
MAHAD
Solved! Go to Solution.
Hi, @Anonymous
You can try the following methods.
Measure:
% Contribution =
DIVIDE(SUM('Table'[Qty]),CALCULATE(SUM('Table'[Qty]),ALL('Table')))
Add the index column to the power query.
Index2 = MAXX(ALL('table'),[index])-MAX([Index])+1
% Contribution (reverse) =
CALCULATE([% Contribution],FILTER(ALL('Table'),[Index2]=SELECTEDVALUE('Table'[Index])))
Cumulative =
CALCULATE(SUMX('Table',[% Contribution (reverse)]),FILTER(ALL('Table'),[Index]<=SELECTEDVALUE('Table'[Index])))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
You can try the following methods.
Measure:
% Contribution =
DIVIDE(SUM('Table'[Qty]),CALCULATE(SUM('Table'[Qty]),ALL('Table')))
Add the index column to the power query.
Index2 = MAXX(ALL('table'),[index])-MAX([Index])+1
% Contribution (reverse) =
CALCULATE([% Contribution],FILTER(ALL('Table'),[Index2]=SELECTEDVALUE('Table'[Index])))
Cumulative =
CALCULATE(SUMX('Table',[% Contribution (reverse)]),FILTER(ALL('Table'),[Index]<=SELECTEDVALUE('Table'[Index])))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Amit
I'm getting the below error for both the formulas.
"Too many arguments were passed to the SUM function. The maximum argument count for the function is 1."
Please can you check and advise.
Thanks
Mahad
Check with open brackets and closing brackets of each function of your query.
Must be passing mutliple arguments to sum function.
@Anonymous , Try like
Cumm = CALCULATE(SUM(Sales[Qty]),filter(allselected('Table'),'Table'[Product] <=max('Table'[Product])))
Cumm % = divide( CALCULATE(SUM(Sales[Qty]),filter(allselected('Table'),'Table'[Product] <=max('Table'[Product]))), CALCULATE(SUM(Sales[Qty]) , allselected()) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |