Forum Discussion
Problems with The Visualization of a Measure With Percentage Variables
- 4 years ago
Sorry for the late reply. I misunderstood it previously. Please try this new measure. The updated pbix file is attached.
Measure 2 = VAR monthTotal = CALCULATE(SUM(Payments[Amount]),ALL(Payments[Customer])) VAR customerTotal = SUM(Payments[Amount]) RETURN DIVIDE(customerTotal,monthTotal)Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Try this measure and put CUSTOMER column into Legend card.
%PAYMENT =
DIVIDE (
CALCULATE ( PAYMENTS[TOTAL] ),
CALCULATE ( PAYMENTS[TOTAL], ALLEXCEPT ( PAYMENTS, PAYMENTS[Month] ) )
)
Let me know if you still have questions.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Good!
Thanks for helping.
It did not give me the expected result to use allexcept in the measure.
I keep trying other variants.
Best regards.
- v-jingzhang4 years ago
Community Support
Can you provide some sample data and the single measure you used to get the closest result in the second image? I guess when you group them into a single measure, it may calculate the % of the total across all months rather than every single month.
BR,
Jing
- Syndicate_Admin4 years ago
Administrator
Good
Measure =where total = CALCULATE([Payments],ALL(Payments))where Red = divide(CALCULATE([Payments],Payments[Customer]="Red"),total)where Green = divide(CALCULATE([Payments],Payments[Customer]="Green"),total)where Violet= divide(CALCULATE([Payments],Payments[Customer]="Violet"),total)where BRead = divide(CALCULATE([Payments],Payments[Customer]="Blue"),total)where Orange= divide(CALCULATE([Payments],Payments[Customer]="Orange"),total)where customer =Red+Green+Violet+Blue+Orangereturn CALCULATE(DIVIDE(customer,total),ALLEXCEPT(Payments,Payments[Customer]))
Thinking better.. in total you should not put ALL()
I still do not solve it, for the moment, I continue with the "long" method to move forward but I seek to change it.- v-jingzhang4 years ago
Community Support
I create a sample with some dummy data. Download the attachment at bottom to see if it can be applied to your model. Let me know if you have any questions.
BR
Jing