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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to filter for 2 conditions

I want to filter my table for two conditions: There are 3 fields in table
Date Posted    Date applied   Type
02/01/2020     03/01/2020       1
03/01/2020     04/01/2020       1
01/01/2020     02/01/2020       2
02/01/2020     03/01/2020       2

I only want date posted for feb for type 1  and date applied for feb for type 2 so I would end up with only 2 records in my file the first and the third.   Is it possible to do with slicers?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Anonymous ,

 

you have to create unrelated tables that you can use to feed the slicers.

 

Then you have to create a measure that filters the "original" table, that meaure can look like this:

measure = 
CALCULATE(
    SUM('tablename'[numeric column])
    ,TREATAS('unrelated table from slicer1'[columnname] , 'tablename'[Date Postes])
    ,TREATAS('unrelated table from slicer1'[columnname] , 'tablename'[Date Applied])
    ,...
)

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey @Anonymous ,

 

you have to create unrelated tables that you can use to feed the slicers.

 

Then you have to create a measure that filters the "original" table, that meaure can look like this:

measure = 
CALCULATE(
    SUM('tablename'[numeric column])
    ,TREATAS('unrelated table from slicer1'[columnname] , 'tablename'[Date Postes])
    ,TREATAS('unrelated table from slicer1'[columnname] , 'tablename'[Date Applied])
    ,...
)

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

It works!

parry2k
Super User
Super User

@Anonymous it is possible but you have to create separate table with each slicer and then use the selected value in your measure to filter you data table, in short, it is possible, not out of the box.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I want my user to select feb as their date and not worry about the type.  So the date field applies to posting date if type =1 or applied date if type 2.  Is there a better way to do this besides slicers?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.