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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
juanso14
Helper I
Helper I

Problems to calulate a sum of sales with parent.

Hello , im working in Power BI with dynamics 365, and i have some accounts that are parent from another in one table, and I have the total sales for the parent account in another tabler and the % of sales of the child for the total of the parents (the % is on the account table). I Have to multiply the partent sale by the %, but the problem is that same account dont have subsidiary and in that case de % is in blank, is any formula for that?

 

The problem is that i Have an ID for the account and the relationship of the parent with another column. And the sale table only have the name (no the id).

 

I made this caluculation

 Ventas Calculado x % = CALCULATE(SUM('Ventas 17-18'[Ventas Total USD]))

But when i do that a lot of account bring me the same number (493174)

i made the following formula:

 

Ventas Calculado x %2 =
VAR current_account =
SELECTEDVALUE ( Cuentas[accountid] )
VAR _parent =
CALCULATETABLE (
VALUES ( Cuentas[_parentaccountid_value] ),
FILTER ( ALL ( Cuentas), [accountid] = current_account )
)
RETURN
CALCULATE (
SUM ( 'Ventas 17-18'[Ventas Total USD] ),
FILTER ( ALL ( Cuentas ), [accountid] IN _parent )
)

But the results were not ok. Look:


I attach a pbix example:

https://wetransfer.com/downloads/a39ec4dd023cfc76f3a4fb89ed3970ea20180215195946/df40b32e8e009e67382d...

Thanks
Juan Vido

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@juanso14,

 

You may try to use LOOKUPVALUE Function to add calculated column first.

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

Hello, @v-chuncz-msft. Thanks for your answer. 

 

But I Have the following problem:

 

lookup.JPG

 

Thanks,

 

Best Regards

 

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors