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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
AC4
Frequent Visitor

Returning a list of distinct rows that have been deselected by a slicer/filter

Hi All,

 

I have a tooltip on all pages in my report that shows what the user has selected/not selected on slicers on the landing page.

 

It works perfectly outside of the not selected "list", which currently concatenates all the "not selected" rows in the table, rather than just the distinct "not selected" rows in the table.

 

Part of the dax is below 

 

Selection RAG =
VAR SelectedValues =
    VALUES ( 'Account'[Account Group] )
VAR ConcatTable = CONCATENATEX (
            CALCULATETABLE ( SelectedValues ),
            'Account'[Account Group],
            ", "
        )
VAR ConcatTableExcept = CONCATENATEX (
            CALCULATETABLE ( Account, Except(All(Account[Account Group]), SelectedValues)),
            'Account'[Account Group],
            ", "
        )
 
The VAR ConcatTable works fine and concatenates values that have been selected in the slicer and is used when the number of selected values in the slicer is a low number
The VAR ConcatTableExcept is used when the number of deselected values in the slicer is low and number of selected values is high, except the problem is it returns all the rows in the table that havent been selected in the slicer rather than the distinct values that have not been selected.

I have tried to wrap the All inside of a distinct function like this 
Distinct(All(Account[Account Group])) and various other means but have not cracked the code yet.
 
Some example screenshots below.
 
When Sales Development is not selected (All rows containing Sales Development)
 AC4_0-1705425555884.png

 

When only Sales Development is selected (correct)

AC4_1-1705425639190.png

 

Any help would be greatly appeciated
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@AC4 Your ConcatTableExcept needs to be an EXCEPT of ALL('Table'[Column]) and your ConcatTable table.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@AC4 Your ConcatTableExcept needs to be an EXCEPT of ALL('Table'[Column]) and your ConcatTable table.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler Thanks!

I removed the table reference as the first argument from CALCULATETABLE and left the expression as the table to calculate.

VAR ConcatTableExcept = CONCATENATEX (
            CALCULATETABLE ( Distinct(Except((All(Reconciliator[Reconciliator Account Group])), (SelectedValues)))),
            'Reconciliator'[Reconciliator Account Group],
            ", "
        )




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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