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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate budget with condition in the other table

Hi

Hi all,

 

I am creating a measure to calculate the budegt, I need to use the condition which is Budget Amount =0 in Level 8 table, but the result is wrong. I am thinking probably the relation between Level 8 and Level 9 is many to many and both direction causes the error.

Cost without Budget = CALCULATE(SUM('Account Ledger (Level 9)'[Cost to Date]),  'Account Master (Level 8)'[Revised Budget Amount] = 0)

 

I really need help to figure it out.

 

Thank you in advance!

 

 

babyjb123_0-1657062345086.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your statement, I think there should be multiple [Revised Budget Amount] for same keycolumn in Account Master (Level 8). Keycolumn should be the column which we are using to connect "Account Master (Level 8)" and "Account Ledger (Level 9)". 

Try this code to create a measure.

Measure = 
CALCULATE(
SUM('Account Ledger (Level 9)'[Cost to Date]),
FILTER(ALL('Account Ledger (Level 9)'),
CALCULATE(SUM('Account Master (Level 8)'[Revised Budget Amount]),FILTER(ALL('Account Master (Level 8)'),'Account Master (Level 8)'[Keycolumn] = MAX('Account Ledger (Level 9)'[keycolumn]))) = 0)
)

Here is my sample.

RicoZhou_1-1657526457474.png

RicoZhou_2-1657526465026.png

RicoZhou_0-1657526450022.png

Result is as below.

RicoZhou_3-1657526476307.png

 

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.

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,what error it is giving

 

Try like

Cost without Budget = CALCULATE(SUM('Account Ledger (Level 9)'[Cost to Date]),Filter( 'Account Master (Level 8)',  'Account Master (Level 8)'[Revised Budget Amount] = 0) )

 

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your statement, I think there should be multiple [Revised Budget Amount] for same keycolumn in Account Master (Level 8). Keycolumn should be the column which we are using to connect "Account Master (Level 8)" and "Account Ledger (Level 9)". 

Try this code to create a measure.

Measure = 
CALCULATE(
SUM('Account Ledger (Level 9)'[Cost to Date]),
FILTER(ALL('Account Ledger (Level 9)'),
CALCULATE(SUM('Account Master (Level 8)'[Revised Budget Amount]),FILTER(ALL('Account Master (Level 8)'),'Account Master (Level 8)'[Keycolumn] = MAX('Account Ledger (Level 9)'[keycolumn]))) = 0)
)

Here is my sample.

RicoZhou_1-1657526457474.png

RicoZhou_2-1657526465026.png

RicoZhou_0-1657526450022.png

Result is as below.

RicoZhou_3-1657526476307.png

 

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.

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)