Forum Discussion
Two measures with diffrent slicer selection for same column
- 5 months ago
Hi sanjaymithran , Thank you for reaching out to the Microsoft Community Forum.
Yes, switching to TREATAS will perform better. TREATAS applies a proper column filter (like a virtual relationship), which allows the Storage Engine to handle the filtering efficiently instead of iterating the whole table in the Formula Engine.
Rewrite your measure like this:
Sales1 =
CALCULATE(
SUM(Data[sales]),
TREATAS(VALUES(Slicer1[Quarter]), Data[Quarter]),
Data[ProdGroup] = "Term",
Data[Type] = "Actual"
)
Hi sanjaymithran,
You can try this:
Create 2 small tables with just your quarter names (Q1 2025, Q2 2025, etc.), don't link them to anything in your model. These are just for the slicers.
Then 2 simple measures:
Sales1 = CALCULATE( SUM(FactSales[sales]), TREATAS(VALUES(Slicer1[Quarter]), DimDate[Quarter]) )
Sales2 = CALCULATE( SUM(FactSales[sales]), TREATAS(VALUES(Slicer2[Quarter]), DimDate[Quarter]) )
In your visual: Put dim1 on rows, Sales1 and Sales2 as values. Add 2 separate slicers, one for each quarter table.
Now you can pick Q1 in one slicer and Q4 in the other, each measure respects its own slicer!
TREATAS is doing the magic here, it tells each measure which quarter to use from your actual date table.
Thanks in advance and kudos if this helps!
Thanks QuentinGa,what the logic for DimDate[Quarter]? tried below logic not workout