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
Jensk
Frequent Visitor

Static calculation independent on hierarchical slicing

I need to slice by a hierarchy of entities that consists of companies that each have their customers. I can look at numbers for the Entity or for a Company within the Entity:

entity_selected_revenue.png

My Measures:

Revenue = SUMX( Sales, Sales[Amount] * Sales[Price] )
Revenue Entity = CALCULATE( [Revenue], ALLSELECTED(), VALUES(Sales[Entity]))

 

Now when I select a company, I would want my 'Revenue Entity' to remain unchanged but it is not:

comp_selected_revenue.png

What is wrong with my 'Revenue Entity' measure? I would think the ALLSELECTED() removed the filter context and calculate by Entity. I need it to calculate the revenue for all companies that have the same entity as the selected company. In my data customer3 and customer4 only have revenue in company2.

3 REPLIES 3
melanid
Frequent Visitor

Hi, 

 

Good ! I may have an other idea, you need to specify the column for the function ALLSELECTED(). Maybe if you try ALLSELECTED(Company) or ALL(COMPANY) ?

 

Best regards,

melanid
Frequent Visitor

Hi,

 

Did you try the REMOVEFILTERS() function? 

 

Maybe something like REMOVEFILTERS(Customer) will work (instead of ALLSELECTED). 

 

Best regards,

Jensk
Frequent Visitor

Thanks for the suggestion.
Using REMOVEFILTERS(Sales[Customer]) instead of ALLSELECTED() yields the same result.
Using REMOVEFILTERS(Sales[Company]) instead of ALLSELECTED() yields the same result for rows, but the total is correct.

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.