Forum Discussion
overwrite visual filters in calculated column
- 1 year ago
Hi han_rj ,
Thanks for reaching out to the Microsoft fabric community forum.
SamsonTruong , danextian ,Thanks for your prompt response
han_rj ,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Best Regards,Lakshmi Narayana
han_rj Are there any slicers in your report? The current DAX will ignore all filters on the report including slicers, which may be causing the discrepancy. The one below will respect slicers and only override the visual level filters for CountryRegion and Occuptation:
SalesAmount_OverrideComputers =
VAR IsComputers = SELECTEDVALUE('Product Subcategory'[product_category_new]) = "Computers"
RETURN
IF(
IsComputers,
CALCULATE(
SUM('Sales'[SalesAmount]),
ALL('Product Subcategory'[product_category_new]),
REMOVEFILTERS('Customer'[CountryRegion]),
REMOVEFILTERS('Customer'[Occupation]),
'Customer'[CountryRegion] = "Canada",
'Customer'[Occupation] = "Clerk"
),
SUM('Sales'[SalesAmount])
)
This is removing country and occupation entirely on Computers