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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

How Formula Only Works for Parent, not Child Level?

Hi Guys,

I am pretty new to power BI and please help me for this formula. I'd like to create the formula Needed to selling to meet Target =100-parent sales, but I don't want the formula works for child level. Because our target is based on parent level. So how can I avoid the formula calculate child name. For example, the formula only show Parent A and B, not show A1,A2,B1,B2...

Thanks. 

Parent 

Child

Sales

Needed to selling to meet Target

A

 

96

=100-96

 

A1

64

 

 

A2

32

 

B

 

45

=100-45

 

B1

13

 

 

B2

32

 

 

B3

45

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create a measure as follows.

Measure = 

var x1=100-CALCULATE(SUM(P_C[Sales]),ALLEXCEPT(P_C,P_C[Parent]))

return

IF(HASONEVALUE(P_C[Sales]),BLANK(),x1)
Then you can create a matrix visual.
 

v-yuaj-msft_0-1615171504891.png

Result:

v-yuaj-msft_0-1615171438545.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

Hi @Anonymous ,

 

Based on your description, you can create a measure as follows.

Measure = 

var x1=100-CALCULATE(SUM(P_C[Sales]),ALLEXCEPT(P_C,P_C[Parent]))

return

IF(HASONEVALUE(P_C[Sales]),BLANK(),x1)
Then you can create a matrix visual.
 

v-yuaj-msft_0-1615171504891.png

Result:

v-yuaj-msft_0-1615171438545.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , You should able to that with help from isinscope

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

https://xxlbi.com/blog/new-dax-function-isinscope/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.