Forum Discussion
How to calculate total Sum in Matrix visual with complex calculation?
- 3 years ago
Hi OliTFD check out my blog post on this (I had a similar case where I wanted to sum quantities per productid , I am pretty sure you will find it useful). It is based on the SUM() OVER PARTITION BY of SQL , I think you can also use the same logic for your COUNT https://www.iipowerblog.com/post/sum-over-partition-by-in-powerbi
Hi OliTFD ,
According to your statement, I think your want to get subtoatl in country level by another calculate logic. However, I am still confused about your calculate logic for red part in your screenshot. Here I suggest you to try ISINSCOPE() function to achieve your goal. Here I use 1 in hand calculate part.
Level % =
VAR _HAND_CALCULATE = 1
RETURN
IF (
ISINSCOPE ( Facts[Type] ),
SUM ( Facts[Level] ),
IF ( ISINSCOPE ( Facts[Country] ), _HAND_CALCULATE )
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.