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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

DAX Measure filter value different slicer's selected value

Hi,

 

I have the following table :

 

NameStatusTeam
AHP 1 ATeam A
AHP 2BTeam A
AHP 3CTeam A
AHP 4ATeam B
AHP 5BTeam B
AHP 6CTeam B
AHP 7ATeam B
AHP 8BTeam B
AHP 9CTeam B
AHP 10ATeam B
AHP 11BTeam B
AHP 12CTeam C
AHP 13ATeam C
AHP 14ATeam C
AHP 15ATeam C
AHP 16BTeam C
AHP 17CTeam D
AHP 18ATeam D
AHP 19BTeam D
AHP 20CTeam D

 

I would like to count Name of certain Status which have the Team different from the Team selected in slicer.

For example : when I select "Team B" in slicer

The "Team B" should be excluded from the measure

NameStatusTeam
AHP 1 ATeam A
AHP 13ATeam C
AHP 14ATeam C
AHP 15ATeam C
AHP 18ATeam D
AHP 2BTeam A
AHP 16BTeam C
AHP 19BTeam D
AHP 3CTeam A
AHP 12CTeam C
AHP 17CTeam D
AHP 20CTeam D

So the result of measure should be : 

 

Status Name
A5
B3
C4

thanks in advance

Regards,

Tg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Based on my testing, if there is multiple values selected in the slicer, please try the following methods:

1.Drag the Table Team field into the slicer visual.

vjiewumsft_0-1715755761176.png

2.Create the new measure to calculate the number for each status.

Total team = CALCULATE(
        COUNTROWS('Table'),
        ALLEXCEPT('Table', 'Table'[Status])
    )

vjiewumsft_1-1715755776530.png

3.Create the new measure to calculate the selected values on a slicer.

Team selected = 
var tea = VALUES('Table'[Team])
RETURN
CALCULATE(
        COUNTROWS('Table'),
        FILTER(ALLEXCEPT('Table', 'Table'[Status]), 'Table'[Team] in tea)
    )

vjiewumsft_2-1715755796898.png

4.Create the new measure to calculate the values exclude the slicer selected.

Exclude selected = [Total team] - [Team selected]

5.Drag the measure into the table visual. The result is shown below.

vjiewumsft_3-1715755843951.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Anonymous ,

First of all, many thanks to @mh2587  for your very quick and effective replies.

Based on my testing, please try the following methods:

1.Create the simple table.

vjiewumsft_0-1715051883805.png

2.Drag the slicer table Team field into the slicer visual.

vjiewumsft_1-1715051897492.png

3.Create the new measure to filter value.

 

Measure_Name = 
VAR SelectedTeam = SELECTEDVALUE('Table slicer'[Team])
RETURN
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(
            ALLEXCEPT('Table', 'Table'[Status]),
            'Table'[Team] <> SelectedTeam
        )
    )

 

4.Select Drag the status field and measure into the table visual.

vjiewumsft_2-1715051928826.png

5.The result is shown below.

vjiewumsft_3-1715051935592.png

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous Hi, 

Thank you again. I applied your solution and I have one question, if there is multiple values selected in the slicer, what should I adjust in the measure please ? 

 

Regards,

Tg

Anonymous
Not applicable

Hi @Anonymous ,

Based on my testing, if there is multiple values selected in the slicer, please try the following methods:

1.Drag the Table Team field into the slicer visual.

vjiewumsft_0-1715755761176.png

2.Create the new measure to calculate the number for each status.

Total team = CALCULATE(
        COUNTROWS('Table'),
        ALLEXCEPT('Table', 'Table'[Status])
    )

vjiewumsft_1-1715755776530.png

3.Create the new measure to calculate the selected values on a slicer.

Team selected = 
var tea = VALUES('Table'[Team])
RETURN
CALCULATE(
        COUNTROWS('Table'),
        FILTER(ALLEXCEPT('Table', 'Table'[Status]), 'Table'[Team] in tea)
    )

vjiewumsft_2-1715755796898.png

4.Create the new measure to calculate the values exclude the slicer selected.

Exclude selected = [Total team] - [Team selected]

5.Drag the measure into the table visual. The result is shown below.

vjiewumsft_3-1715755843951.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous Many thanks for your help. 😊

Anonymous
Not applicable

Thank you for your time and quick reply.  The table has more than 20K lines, I would like to find a solution without create new table.

In addition, the expect result is not a table (I wasn't clear enough, sorry). 

I would like to create 3 cards (for 3 statuses) which count the Name having the different group from the slice's selected value , then I can export these names. 

 

 

 

mh2587
Super User
Super User

Measure = //Try this
COUNTROWS (
    FILTER (
        ALLSELECTED ( 'TableName' ),
        'TableName'[Team] <> SELECTEDVALUE ( 'TableName'[Team] )
            && 'TableName'[Status] IN {"A", "B", "C"} // Specify the certain statuses here
    )
)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Anonymous
Not applicable

@mh2587 Thank you for your prompt response. 

The measure doesn't sort out the expected Name.

The expected result is not a table (I wasn't clear enough, sorry). 

I would like to create 3 cards (for 3 statuses) which count the Name having the different group from the slice's selected value , then I can export these names. 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.