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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Ivancito111
Resolver I
Resolver I

Use of the OR condition between segmentations to filter a table

Hello,

 

I have the following request:
I have 4 Segmentations, the first one filters by AA, the second BB, the third CC and the fourth DD.

All filters are from a column of the table I want to filter.
The problem is that when I filter the table with the segmentations a && is applied. For example, if I select AA "Yes" in the first segmentation and BB "No", I will have all the tasks with AA "YES" && BB "NO".
What I would like is that all tasks with AA "YES" || BB "NO". Without leaving aside the 4 segmentations, if I also want to filter by CC "NO", the table will be seen with AA "YES" || BB "NO" || CC "NO".

 

Illustration of my table:

Ivancito111_0-1629733788314.png

 

Ilustration of my slicer:

Ivancito111_1-1629733818525.png

 

Example segmentation:

Ivancito111_2-1629733880707.png

Ivancito111_3-1629733902944.png

 

In addition to that I would like that if I filter by only one also works since all the solutions I have found do not allow me to filter by only one task.

Any kind of information would be very helpful, and thank you for taking the time to read my problem.

Thanks in advance.
Regards.

1 ACCEPTED SOLUTION

Hi @Ivancito111 ,

 

I modified it so that now there is no need to filter the Name column, you just need to add the Measure to the visual filter and set it to not blank.

 

vkkfmsft_0-1630053046327.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

9 REPLIES 9
amitchandak
Super User
Super User

@Ivancito111 , You need an independent slicer for that. Create independent table with Yes and No value

 

var _1 = selectedvalue(Table1[Value])

var _2 = selectedvalue(Table2[Value])

return

calculate(countrows(Table), Filter(Table, [AA] =_1 && [BB] =_2))

 

refer if needed

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear I tried this idea and it does not meet my requirement, as I need multiple slicers to perform an OR condition. Not a standalone slicer, yes, it serves its purpose but it is not my requirement, thanks anyway.

 

Regards.

Hi @Ivancito111 ,

 

Please create a table:

 

Slicer = 
CROSSJOIN(
    DISTINCT('Table'[AA]),
    DISTINCT('Table'[BB]),
    DISTINCT('Table'[CC]),
    DISTINCT('Table'[DD])
)

vkkfmsft_0-1629939088452.png

 

Then create measure and filter NAME column by Measure.

 

Measure = 
var tab = 
CALCULATETABLE(
    VALUES('Table'[NAME]), 
    FILTER(
        'Table', 
        'Table'[AA] = SELECTEDVALUE(Slicer[AA])
        || 'Table'[BB] = SELECTEDVALUE(Slicer[BB])  
        || 'Table'[CC] = SELECTEDVALUE(Slicer[CC])
        || 'Table'[DD] = SELECTEDVALUE('Slicer'[DD]) 
    )
)
return 
IF( 
    ISFILTERED(Slicer),
    COUNTROWS( 
        INTERSECT( VALUES('Table'[NAME]), tab ) 
    ),
    COUNTROWS( 
        INTERSECT( VALUES('Table'[NAME]), VALUES('Table'[NAME]) ) 
    )
)

vkkfmsft_1-1629939199909.png

 

Put the fields in table Slicer into the slicers separately and change the interaction between the slicers to "None".

 

vkkfmsft_2-1629939554492.png

image.pngimage.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

 

Hello friend, I really appreciate the time you took to help me and that's why I tried to answer you in the shortest time possible.
That said, let's move on to what matters, it didn't work for me, it still works as an AND (&&), although it works as OR ( || ) for you.

I will attach the necessary pictures so that you can understand what I did and how I did it, since I tried to upload the file but I did not understand how.

 

BD:

 

Ivancito111_0-1629998998684.png

Ivancito111_1-1629999019744.png

 

Slicer:

Ivancito111_2-1629999053259.png

 

Measure:

Ivancito111_3-1629999085872.png

Filter in table:

Ivancito111_4-1629999138264.png

 

Results

Ivancito111_5-1629999266686.png

This is how what you sent me worked for me, which would not fulfill the requirement I have been asked for. I look forward to your reply and thank you very much.

 

Regards,

NamefeaturesPriceLegsAABBCCDD
1Polar Bearxxx10004YESNOYESNO
2Penguinxxx20008YESNOYESNO
3Cowxxx300012NOYESYESNO
4Deerxxx400016NOYESNONO
5Raccoonxxx500020YESYESNOYES
6Whalexxx600024YESNONOYES
7Frogxxx700028NONONOYES
8Sealxxx800032NONOYESYES
9Dromedaryxxx900036YESYESYESYES
10Horsexxx1000040YESYESYESNO
11Bullxxx1100044NOYESYESNO
12Frogxxx1200048NONONONO
13Sealxxx1300052YESNONONO
14Dromedaryxxx1400056YESNONONO
15Cowxxx1500060NOYESNOYES
16Deerxxx1600064NOYESYESYES
17Raccoonxxx1700068YESYESYESYES
18Sealxxx1800072YESNOYESYES
19Dromedaryxxx1900076NONOYESYES
20Cowxxx2000080NONONONO
21Polar Bearxxx2100084YESYESNONO
22Penguinxxx2200088YESYESNONO
23Cowxxx2300092NOYESNONO
24Whalexxx2400096NONOYESNO
25Frogxxx25000100YESNOYESYES
26Sealxxx26000104YESNOYESYES
27Dromedaryxxx27000108NOYESYESYES
28Horsexxx28000112NOYESNOYES
29Bullxxx29000116YESYESNOYES

After a lot of testing I realized that I did not take the values of the slicers correctly, I had taken AA from the table and not from the slicer.

But even so, now the error has intensified, because if I set AA "No" it shows me values with "YES" and so on with all the slicers.

 

Example:

 

Ivancito111_0-1630016191913.png

If you notice I am filtering BB "NO" and CC "YES", but it still shows me the value of BULL that has BB "YES" and CC "NO". Which is incorrect.

Thank you very much for the help 😣

Hi @Ivancito111 ,

 

I modified it so that now there is no need to filter the Name column, you just need to add the Measure to the visual filter and set it to not blank.

 

vkkfmsft_0-1630053046327.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

First thank you, really the solution you gave me in the last message was perfect and serves me completely, but now I have more problems and I do not want to open another forum since here is all the info.

Well the problem is that I am new using DAX, I know how to program in other languages but this one is surpassing me, short story the problem is that all the graphs and cards that I have do not work with the slicer, I tried putting the measure that was created in each graph but it does not work, I attach pictures of the graphs.

 

Dona.png

Barras.png

Name.png

Countrows.png

Price.png

The idea is that when modifying the slicers, these graphics and measurements will also change.

I include idea.

 

Total.png

If it wasn't so urgent I wouldn't ask for so much help, that's why I apologize but it's costing me more than it should something that seems so simple.

Thank you in advance.
Regards,

Hi @Ivancito111 ,

 

I think you need to create some measures to calculate Price\Legs.

 

CountRows = 
CALCULATE(
    COUNTROWS('Table'),
    FILTER( 'Table', [Measure] <> BLANK() )
)
Sum_Legs = 
CALCULATE(
    SUM('Table'[Legs]),
    FILTER( 'Table', [Measure] <> BLANK() )
)
Sum_Price = 
CALCULATE(
    SUM('Table'[Price]),
    FILTER( 'Table', [Measure] <> BLANK() )
)

vkkfmsft_5-1630313180938.pngvkkfmsft_3-1630313131408.pngvkkfmsft_4-1630313150292.pngvkkfmsft_6-1630313201098.png

vkkfmsft_7-1630313223086.png

 

vkkfmsft_8-1630313247266.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

 

 

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.