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

filter in DAX

 

Hi Community I need some help....Im trying to build a DAX but I need to filter certain words which are in other column.

 

Any suggestion to improve my DAX: 

 

MAL ASIGN = CALCULATE(COUNTROWS(base);
ALLEXCEPT(Base;Base[MAL ASIGNADO]);
ALL(Base[MAL ASIGNADO];Base[MAL ASIGNADO]);
Base[MAL ASIGNADO]=1)

 

That formula is working but I still need to add 4 filters which are in a column of my table... how can I solve this? ...I need to add the filter in this formula to get the right  result.

 

1 ACCEPTED SOLUTION

For your example shown in pcture, you could do something like this:

Measure =
CALCULATE ( COUNTROWS ( Table ), NOT ( Table[CRANCOT2] IN { 910, 500, 502 } ) )

View solution in original post

7 REPLIES 7
affan
Solution Sage
Solution Sage

Hi @Anonymous

 

Can you share some sample data and the result you are trying to acheive

 

Regards

Affan

Anonymous
Not applicable

it is a huge pbix... can you give me and idea or something to try @affan

Anonymous
Not applicable

where I should add a filter in that dax formula...I could use "IN" or filter function?

I mean to say that you can copy 5-10 rows of the table in excel and copy paste it in the post here and then what should be the result of the measure.

 

 

Please see this blog post to get your questions answered quickly on community.

Anonymous
Not applicable

Hi @affan, the idea is what I show you in the picture, the problem is that I have to make no consider the bunch of filters there is everywhere in the model.

 

Captura10.PNG

For your example shown in pcture, you could do something like this:

Measure =
CALCULATE ( COUNTROWS ( Table ), NOT ( Table[CRANCOT2] IN { 910, 500, 502 } ) )
Anonymous
Not applicable

THANK YOU @AkhilAshok@!!!!!! SO CLAIR...IN THIS CASE THE FORMULA WORKED perfect and it looks like this

 

MAL ASIGN = CALCULATE(COUNTROWS(base);
NOT Base[CCVISITA] IN {"910"; "500";"502";"501"} ;
ALLEXCEPT(Base;Base[MAL ASIGNADO]);ALL(Base[MAL ASIGNADO];
Base[MAL ASIGNADO]);Base[MAL ASIGNADO]=1;'Grupo R'[RECURSO (groups)]="RE")

 

Really thank you!!!!!!!

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.