Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have PnL fact table like this: fact_table([id],[date],[account_key],[sales_amount]) and dimension for PnL hierarchy like this: dimension_table([account_key],[level_1_name],[level_2_name],[level_2_weight],[level_3_name],[level_3_weight],[level_4_name],[level_4_weight],[level_5_name],[level_5_weight]) relationship between those table is M:N through account_key.
I need to calculate sum of sales_amount with applying the correct weight when going from a lower level of the hierarchy to a higher one.
Not all levels for each account is valid -> each level except one can be null.
I tried everything with INSCOPE, RELATED, SWITCH and SUMX but nothing worked for me.
Link to the file here: PBIX
I would very much appreciate any help.
Thank you very much in advance.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
access denied
I'm sorry. It should be fixed right now.
Looks like you mixed up your dimension and fact tables? How are they supposed to correlate?
I didn't.
In Fact the pnl_acc_chart_key.2 is a FK to the Dimension. In the Dim the same column is not the primary key either. I keep only the necessary columns for the demo.
The Dim should act as a 5lvl hierarchy of accounts weight should be used when the sum of Custom form Fact goes from lower level to higher.
Relationship is through pnl_acc_chart_key.2
So this would be the base. I don't see weights other than 1 and -1. Is that correct?
Is this what you are after?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
11 | |
10 | |
9 | |
8 |