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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Swich between filters dependent on data

Hi

 

Can i one of two filters based on code?

Say like if the colour is orange filter by orange table column values but if green then use anoth filter completely?

 

Any help much appretiated

 

Andy

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Try something like this as per your requirement and data:

Measure= IF(SELECTEDVALUE(TABLE(VALUE))=1, CALCULATE (SUM(Column), filter expression1), CALCULATE (SUM(Column), filter expression2

))

 

Mark this as a solution if I answered your question. Kudos are always appreciated.

Thanks

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi

OK, wasn't very explicit, sorry. If you have a tabular model dataset that has 2 tables in it that can be used for filtering, each with its own data that joins to a different column, in a paginated report I need to create DAX queries that will use one or other of the 2 tables, but not both. The 2 don't form a hierarchy, so I can't use it that way. Filtering will be driven by a combination of data and user selection of parameters. This can be achieved fairy easily in SQL, but I need to do it in DAX, it would be sort of like an if value = 1 then use 1 filter if not use the other, which I have tried in DAX and it just errors with a syntax error, in SQL I would use a case statement in the where clause, but I don't know how to do the same in DAX

 

Any help, much appreciated 

 

Regards

 

Andy  

Hi @Anonymous ,

Try something like this as per your requirement and data:

Measure= IF(SELECTEDVALUE(TABLE(VALUE))=1, CALCULATE (SUM(Column), filter expression1), CALCULATE (SUM(Column), filter expression2

))

 

Mark this as a solution if I answered your question. Kudos are always appreciated.

Thanks

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

Yes, you can use two filters.

But I didn't quite understand your question.

Can you please give us an example.

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors