Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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?
User | Count |
---|---|
52 | |
51 | |
20 | |
17 | |
16 |
User | Count |
---|---|
113 | |
46 | |
44 | |
28 | |
22 |