Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BobbyKothari1
Frequent Visitor

Custom roll up dax measure for parent child hierarchy

Hello Community,

Need your help for below query.
Lets suppose there is one to many relationship between below two table and i want to make a DAX Measure that can flow amount as per parent child relationship between these two table but for few item, i want to create custom roll up measure like for net sales by adding [ 12,27,29] measure key and subtracting [31,32] from the fact_table amount .

I tried this below dax measure but i don't know why it's not working.

BobbyKothari1_0-1727091550744.png

 

Measure Table

MeasureKeyMeasureMeasureParentKeyMeasurepathLevel1DepthLevel2Level3
55Adjustment55|55Revenue n Driver2Adjustment 
35Administrative Surcharge125|12|35Revenue n Driver3SERAdministrative Surcharge
27AR Reserve75|7|27Revenue n Driver3DiscountAR Reserve
32AR Writeoff75|7|32Revenue n Driver3DiscountAR Writeoff
34Charged Fees125|12|34Revenue n Driver3SERCharged Fees
8Charged Hours55|8Revenue n Driver2Charged Hours 
7Discount55|7Revenue n Driver2Discount 
29ERP Reserve75|7|29Revenue n Driver3DiscountERP Reserve
31Fee Adjustments75|7|31Revenue n Driver3DiscountFee Adjustments
9NBP55|9Revenue n Driver2NBP 
10Net Sales55|10Revenue n Driver2NER 
53Net Adjusted Sales55|53Revenue n Driver2NER Adjusted 
11Net Revenue55|11Revenue n Driver2Net Revenue 
363Sales125|12|363Revenue n Driver3SERNSR Amount
13Partner Charged Hours85|8|13Revenue n Driver3Charged HoursPartner Charged Hours
41Realization Percent55|41Revenue n Driver2Realization Percent 
5Revenue n Driver 5Revenue n Driver1  
54RPH55|54Revenue n Driver2RPH 
12Gross sales55|12Revenue n Driver2SER 
14Staff Charged Hours85|8|14Revenue n Driver3Charged HoursStaff Charged Hours

 

Fact Table

EngMeasureKeyAmount
917669
13300457
141184776
2771583
291349109
31386686
3254953
34541787
35142
5511975
363707926
935338
13600914
142369552
27143166
292698218
31773372
32109906
341083574
35284
5523950
3631415852
956540.8
13961462.4
143791283
27229065.6
294317149
311237395
32175849.6
341733718
35454.4
5538320
3632265363


Thanks in advance

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BobbyKothari1 , I have done that here. But you might not need the additional table I have

 

Power BI How to get the P&L formatting right: https://youtu.be/C9K8uVfthUU
Power BI How to get two columns format Profit and Loss Statement(P&L) right: https://youtu.be/WLg85yiMgHI
https://medium.com/microsoft-power-bi/power-bi-formatted-p-l-with-custom-sub-totals-and-blank-rows-e...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@BobbyKothari1 , I have done that here. But you might not need the additional table I have

 

Power BI How to get the P&L formatting right: https://youtu.be/C9K8uVfthUU
Power BI How to get two columns format Profit and Loss Statement(P&L) right: https://youtu.be/WLg85yiMgHI
https://medium.com/microsoft-power-bi/power-bi-formatted-p-l-with-custom-sub-totals-and-blank-rows-e...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

HI @amitchandak ,

Thanks for your content, it was really helpful.
I have also tried switch formula before, but i was n't using with filter and all formula.

appriciate your quick help.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.