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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.