Forum Discussion
jd8766
3 years agoHelper II
Calculate % against total correctly?
Hi, hopefully someone can advise if this can be done. I have 2 tables in PBI, one is a subscripton fact table and one is an unsubscribe reason dimension table. (example below) I wa...
- 3 years ago
Hi, jd8766
You can try the following methods.
Measure = Var _N1=CALCULATE ( SUM ( Subscriptions[Cost] ), FILTER ( ALL ( Subscriptions ), [UnsubscribeReasonKey] <> -1 ), FILTER ( ALL ( UnsubscribeReason ), [Reason] = SELECTEDVALUE ( UnsubscribeReason[Reason] ))) Var _N2=CALCULATE(SUM(Subscriptions[Cost]),ALL(Subscriptions)) Return DIVIDE(_N1,_N2)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.
v-zhangti
3 years agoCommunity Support
Hi, jd8766
You can try the following methods.
Measure =
Var _N1=CALCULATE ( SUM ( Subscriptions[Cost] ),
FILTER ( ALL ( Subscriptions ), [UnsubscribeReasonKey] <> -1 ),
FILTER ( ALL ( UnsubscribeReason ), [Reason] = SELECTEDVALUE ( UnsubscribeReason[Reason] )))
Var _N2=CALCULATE(SUM(Subscriptions[Cost]),ALL(Subscriptions))
Return
DIVIDE(_N1,_N2)
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.