Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shavo26
Frequent Visitor

Unselect multiple raws when only 1 in checked

Hi,
I have a problem that I need help figuring out the solution.
I have a lot of different visuals based on a table, containing an unique ID for each row.
Today, I  have a new table, which contain exception reasons that can apply to some ID. Several reasons can happen on one ID.
I want be able to check/uncheck one or several reasons in a slicer, so that the concerned visuals doesn't display any more information about theses IDs.
It seems simple with a simple link on the IDs between the two tables.

BUT.... I need that when one exception is checked/unchecked, the concerned ID disapear from the visuals even if some other reason still apply to it!
Basically, if reason 1, 2 and 6 apply to ID 123, ID 123 must disappear of the visuals if any of the reason 1, 2 or 6 are selected.
1, 2 and 6 are not linked.

I tried a lot of things :
- doing it on the db side, but I need the choice to check/uncheck reasons dynamically.

- aggregating the reasons on each ID line on the db side, but I can't figure out how to "disaggreagate" it when choosing with the slicer.
- building a reverse slicer that flag the IDs, using a measure to test if the reason is selected AND if the ID is in the list of exceptions, and filtering it on each visual. But the thing is that with the mesure, as soon as the data aggregate differently in the visual, the MAX() results differently.

I need some fresh ideas how to it! If you have some, I'll take any 🙂

Thanks a lot

 

hasException =
IF (CALCULATE ( IF ( ISFILTERED ( ExceptionTable[Reason]), 1, 0 ), ALLSELECTED ( ExceptionTable ) ) = 0,0,
    IF (MAX(IDList[ID]) IN ALLSELECTED(ExceptionTable[ID]),1,0)
)


3 REPLIES 3

Thanks for your solution.
I already tried a lot for the exclusion slicer. The issue thats stay is that the measure is not "linked" to the data and cannot be used in other visuals with the same result, hasException is calculated again depending on the way the data is aggregated.

I think my issue can be formulated as so : how can I link the result of a measure in a visual (itself depending on the slicer result - this part is ok I think) to the data so it stays as an information?
How can hasException be calculated at some point and be linked to the ID for all the visual, so I can filter on it the same way on all the visuals of the report?

Thanks a lot

That is indeed a more difficult question than doing it for a particular measure.

 

I've not tried this, but maybe you could do it by using a calculation group page filter with a calculation item like:

CALCULATE (
    SELECTEDMEASURE (),
    EXCEPT ( VALUES ( Fact[ID] ), VALUES ( Exclude[ID] ) )
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.