The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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:
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.
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,
Hi,
Did you try the REMOVEFILTERS() function?
Maybe something like REMOVEFILTERS(Customer) will work (instead of ALLSELECTED).
Best regards,
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.
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
51 | |
51 | |
46 |