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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
smerchant
Helper I
Helper I

Filter on Two Columns - Same Table

Is there a way to filter data from two columns? For example:

 

C1C2C3C4
AAoher data 
BC  
CE  
DF  

 

I want to have a filter slicer with all the possible values within C1 & C2 to filter, if E is selected as the filter, so if I select C I shoud get row 2 and 3?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

It is possible, by creating a disconnected table for your slicer and a measure. See attached, Page 8, Table14 and Table 4. 

 

Table 4 = 
VAR __table = SELECTCOLUMNS(ALL('Table14'[C1]),"Value",[C1])
VAR __table1 = SELECTCOLUMNS(ALL('Table14'[C2]),"Value",[C2])
VAR __table2 = UNION(__table,__table1)
RETURN
DISTINCT(__table2)


Measure 13 = 
VAR __value = MAX('Table 4'[Value])
VAR __c1 = MAX([C1])
VAR __c2 = MAX([C2])
RETURN
IF(__c1 = __value || __c2 = __value,1,0)

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

It is possible, by creating a disconnected table for your slicer and a measure. See attached, Page 8, Table14 and Table 4. 

 

Table 4 = 
VAR __table = SELECTCOLUMNS(ALL('Table14'[C1]),"Value",[C1])
VAR __table1 = SELECTCOLUMNS(ALL('Table14'[C2]),"Value",[C2])
VAR __table2 = UNION(__table,__table1)
RETURN
DISTINCT(__table2)


Measure 13 = 
VAR __value = MAX('Table 4'[Value])
VAR __c1 = MAX([C1])
VAR __c2 = MAX([C2])
RETURN
IF(__c1 = __value || __c2 = __value,1,0)

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Is it possible to make multiple selections? 😭

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors