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
When you say computers alone, do you mean to apply the filter for that category alone ane everythign else remains the same? Would have been easier for us to understand if you gave us a sample data and from the same sample data, your expected result.
VAR _computersOnly =
CALCULATE (
SUM ( tbl[value] ),
KEEPFILTERS ( 'Product'[category] = "computers" ),
KEEPFILTERS ( Countryregion[countryregion] = "Canada" ),
KEEPFILTERS ( occupation[occupation] = "clerk" )
)
VAR _other =
CALCULATE (
SUM ( tbl[value] ),
KEEPFILTERS ( 'Product'[category] <> "computers" )
)
RETURN
_computersOnly + _other
Note: if filters are from the same table, there's no need to use multiple KEEPFILTERS for that table. Example:
KEEPFILTERS ( 'table'[category] = "computers" && 'table'[countryregion] = "Canada" )