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
J_4923
Frequent Visitor

Creating a hierarchy and summarize per condition

Hi,
I'm new to the world of Power BI and need some guidance/assistance on how to resolve following.
Below is a sample of my table profit.

Capture.JPG
 
I have four different geo locations origin, destination, payer and owner each of them on country, area and region level. To this there are also different profit measures origin, destination, payer and owner.
What I would like to achieve is total profit per geo.
E.g.
 Key 1 region ASI should have profitorigin + profitdestination + profitpayer (as totalprofit) and EUR profitOwner  (as totalprofit)
And so on..
I would also like be able to drill down from region to area to country on total profit.
Any inputs appreciated, thanks!

1 REPLY 1
v-yuezhe-msft
Employee
Employee

Hi @J_4923,

I am not quite clear about that how you calculate profit. If you mean that for key 1, total profit for ASI OriginRegion is 523.856+523.856+130.964, and total profit for EUR OwnerRegion is 130.964. Then for key 8, total profit for AME OriginRegion is 94.8+94.8+23.7 , and total profit for IMEA OwnerRegion is 23.7. You would need to unpivot your tables as shown in the first screenshot,  then create a column using the DAX and you can create a table visual to shown result.

totalprofit = IF('Table5 (2)'[Attribute]="OriginRegion",'Table5 (2)'[ProfitOrigin]+'Table5 (2)'[ProfitDestination]+'Table5 (2)'[ProfitPayer], IF('Table5 (2)'[Attribute]="OwnerRegion",'Table5 (2)'[ProfitOwner],0))
1.PNG3.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.