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

Using a multiple filter

Hi everyone,

 

This is my first post and, first of all, hello to everyone here 🙂

 

I'm new to Power BI ( a few days) and i'm trying to built a Production management tool for my company.

 

I have a table where i have a production table with these items : SITE, CUSTOMER, PRODUCT TYPE, PRODUCT ID

And a table where i have my goals by SITE, CUSTOMER and PRODUCT TYPE.

 

In this last table i wan to have a calculater column that counts the number of product ID for each line of my goals table. So i try to use the COUNTROWS function in a filtered version of my production table with this expression :

 

PRODUCTION= COUNTROWS(FILTER(PRODUCTION;PRODUCTION[SITE]=GOALS_2017[SITE]&&PRODUCTION[PRODUCT TYPE]=GOALS_2017[PRODUCT_TYPE]&&PRODUCTION[CUSTOMER]=GOALS_2017[CUSTOMER]))

 

It works with one filter but when i put a second filter with the && operator it does not work anymore...

 

Can you help me please ? 🙂

 

Thanks !

5 REPLIES 5
ovetteabejuela
Impactful Individual
Impactful Individual

Can you post the sample table please?

Anonymous
Not applicable

Of course, here is my production table :

 

MEXTPSOUS SERIEOPERATIONCODE ETABENTREESORTIE
8087977370009906R39DEP5793227/12/201602/01/2017
8087977584109906R39DEPOCW5214029/12/201602/01/2017
1187393871403425R90DEP1275730/12/201602/01/2017
8187353899703425R30REPOCW5214029/12/201602/01/2017

 

And my goal table :

 

CODE ETABOPERATIONTPOBJECTIF
57932DEP990620
52140DEPOCW3425362

 

I would like to create a new column in my goal table with the number of MEX produced for the DEP operation by the CODE ETAB 57932 for the TP 9906 to be able to compare it to the goal (objectif).

 

Thanks 🙂

You could try a calculated table like this...

 

New Table = SUMMARIZE(
        FILTER(
            CROSSJOIN('Production','Goals_2017'),
            --- Join criteria here
            'Goals_2017'[CODE ETAB] = 'Production'[CODE ETAB]
            && 'Goals_2017'[OPERATION] = 'Production'[OPERATION]
            && 'Goals_2017'[TP] = 'Production'[TP]
            ),
            'Goals_2017'[CODE ETAB],
            Goals_2017[OPERATION],
            Goals_2017[TP],
            Goals_2017[OBJECTIF],
            "Count of Mex",COUNTROWS('Production')
            )

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

It's working... ...but if the result of the count mex item is zero, it will show nothing.

 

I would like to have all the items even if the countrows result is zero, is it possible ?

Anonymous
Not applicable

Unsolved the topic...

 

Anyone on this ? 🙂

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.