Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All, Need help overwrite visual filters on the same feild but only for a single row in a table.
I have a calculated column as folows
Attached is the existing view and the expected view to build, Please may I have help
Solved! Go to Solution.
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
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
Hi @han_rj ,
If your issue has been resolved, please consider marking the most helpful reply as the accepted solution. This helps other community members who may encounter the same issue to find answers more efficiently.
If you're still facing challenges, feel free to let us know we’ll be glad to assist you further.
Looking forward to your response.
Best regards,
LakshmiNarayana.
Hi @han_rj ,
If your question has been answered, kindly mark the appropriate response as the Accepted Solution. This small step goes a long way in helping others with similar issues.
We appreciate your collaboration and support!
Best regards,
LakshmiNarayana
Hi @han_rj ,
As we haven't heard back from you, we are closing this thread. If you are still experiencing the same issue, we kindly request you to create a new thread we’ll be happy to assist you further.
Thank you for your patience and support.
If our response was helpful, please mark it as Accepted as Solution and consider giving a Kudos. Feel free to reach out if you need any further assistance.
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" )
Hi @han_rj ,
To have the sales amount remove the visual filters when the product category is "Computer", you can leverage the following DAX measure for sales amount:
SalesAmount_OverrideComputers =
VAR IsComputers = SELECTEDVALUE('Product Subcategory'[product_category_new]) = "Computers"
RETURN
IF(
IsComputers,
CALCULATE(
SUM('Sales'[SalesAmount]),
REMOVEFILTERS('Product Subcategory')
),
SUM('Sales'[SalesAmount])
)
If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.
Thanks,
Samson
Hi @SamsonTruong thank you for responding , I have to override the above filters like country and occupation on the row Computer
Hi @han_rj ,
Which column are you trying to override the visual filters for. Are you trying to override the filters on the Sales Amount column or the calculated column you created for product_category_new.
If you are trying to have the sales amount for computer override the visual filters, creating the DAX measure in the previous response and using that measure to replace your Sales Amount will ensure that Sales Amount for Computer will not have the visual filters applied.
Hi @han_rj ,
To achieve your desired result, please follow the steps below:
Create a new measure using the following DAX:
SalesAmount_OverrideComputers =
VAR IsComputers = SELECTEDVALUE('Product Subcategory'[product_category_new]) = "Computers"
RETURN
IF(
IsComputers,
CALCULATE(
SUM('Sales'[SalesAmount]),
ALL('Product Subcategory'[product_category_new]),
'Customer'[CountryRegion] = "Canada",
'Customer'[Occupation] = "Clerk"
),
SUM('Sales'[SalesAmount])
)
Once created, remove your current Sales Amount column from your visual. Then add the newly created measure. This will make sure that the visual filters still apply to your other rows. This measure will remove the visual filters when calculating the Sales Amount for the Computer category. When adding the new measure into your visual, the Sales Amount for your other categories will remain the same.
If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.
Thanks,
Samson
But for computer I need to remove CountryRegion = France or Canada and occupation = Management and override the filter with CountryRegion canada and occupation Clerk. This Part is not there.
More precisely my question is how to overwrite filters on a single row alone for visuals filters on the same column
Hi @han_rj ,
Apologies, I missed the portion of overriding with new filters, please try the same steps with the adjusted DAX measure:
SalesAmount_OverrideComputers =
VAR IsComputers = SELECTEDVALUE('Product Subcategory'[product_category_new]) = "Computers"
RETURN
IF(
IsComputers,
CALCULATE(
SUM('Sales'[SalesAmount]),
ALL('Product Subcategory'[product_category_new]),
'Customer'[CountryRegion] = "Canada",
'Customer'[Occupation] = "Clerk"
),
SUM('Sales'[SalesAmount])
)
This will first remove the filters on the Computers category, then apply the new filters.
No this does not gives the correct value, 4329 should have been the sales in computer for the measure SalesAmount_OverrideComputers but there is someother value
@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
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
43 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |