Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Multiple filters counta

Hello, I 've been trying to solve this measure for a while. Every help is appreciated. 

Data table has different values in Sufix template. Those values are connected with load number and I want to return a number of rows which include both values like A3 and VCG. 

In case load number has both values then returned value shoul be 1. 

 

I have tried many calculation but none return a correct value. 

 

Here is last calulation i tried:

measure2 = CALCULATE(
COUNTA(Load_data_merged[Load number]),
FILTER(ALL(Load_data_merged[Sufix_template.FDP]),Load_data_merged[Sufix_template.FDP] = "A3" && Load_data_merged[Sufix_template.FDP] = "VCG"))
 

Thank you 

  • Hi,

    Here is one way to do this:

    Data:


    Dax:

    LoadNumbertest = if(countrows(
    FILTER(LoadNumber,
    LoadNumber[LoadNumber]=MAX(LoadNumber[LoadNumber])
    &&LoadNumber[Code]="A3"
    ||LoadNumber[Code]="VCG"))>1,1,0)
     
    End result:

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

     

2 Replies

  • ValtteriN's avatar
    ValtteriN
    Icon for Community Champion rankCommunity Champion

    Hi,

    Here is one way to do this:

    Data:


    Dax:

    LoadNumbertest = if(countrows(
    FILTER(LoadNumber,
    LoadNumber[LoadNumber]=MAX(LoadNumber[LoadNumber])
    &&LoadNumber[Code]="A3"
    ||LoadNumber[Code]="VCG"))>1,1,0)
     
    End result:

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you