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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
n3ptune
Helper II
Helper II

Calculating Parent and child revenue

There is a field parent and a field child.

i want to have a matrix table which will be filtered from date range and parent filter and i want to see the amounts for child revenue and parent revenue change based on the filters. The problem is with the measure 
calculate([revenue],allexcept (table,parent,transactiondate).
(if i will take out transaction date then the measure will not be filtered from date selection)

i want to have in the matrix 

parent name - child name - revenue for selected dates Child- revenue for selected dates Parent

 

so the parent revenue should be always the same if we select a specific parent but its not.

example

 

parent.   child  revenue-child.   revenue-parent

1            abc.      10000                  50000

1            def.       20000                  50000

1            ghi        20000                  50000

 

this is the expected result

 

 

 

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@n3ptune 
In case you have multiple parent id. Try measures:

 

Child revenue    = Calcuate(sum([revenue]), Filter(allselected(table),[child]=max([child]))

Parent revenue  = Calcuate(sum([revenue]), Filter(allselected(table),[parent]=max([parent]))

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
V-pazhen-msft
Community Support
Community Support

@n3ptune 
In case you have multiple parent id. Try measures:

 

Child revenue    = Calcuate(sum([revenue]), Filter(allselected(table),[child]=max([child]))

Parent revenue  = Calcuate(sum([revenue]), Filter(allselected(table),[parent]=max([parent]))

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@n3ptune your question is not clear, do you want to have some of all the parents or just the sum of parents against each child of that parent. Always share data and example output that describe the problem and expected output, in your example data, your just showed one parent and it is not clear what you are actually looking for.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  just the sum of parents against each child of that parent, so for example if i filter a parent called "1" the output should be 

parent.   child  revenue-child.   revenue-parent

1            abc.      10000                  50000

1            def.       20000                  50000

1            ghi        20000                  50000

 

parry2k
Super User
Super User

@n3ptune add the following measures:

 

Sum Rev = SUM ( 'Table'[Revenue] )

Parent Rev = CALCULATE ( [Sum Rev], ALL ( 'Table'[child] ) ) 

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k this is what i get

n3ptune_0-1622008983775.png

on the left i have the parent and child columns and there is a date selection filter.

@parry2k the expected result should be 221629 in all rows at parent revenue column.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.