Forum Discussion

jmcph's avatar
jmcph
Helper III
5 years ago
Solved

DAX filter problems

Hi, I hope you can help me with my little problem.   I have this table.    Book                 Reference #                 Code                   Date                   Amt Eco                 ...
  • amitchandak's avatar
    5 years ago

    jmcph , This should work. what is the wrong you are getting? You should also get a row for Ref102.

     

    try measure like

    Sumx (filter(Table,[Book] = "Eco"), Table[Amt])
    Sumx (filter(Table,[Book] = "Pro"), Table[Amt])

  • v-alq-msft's avatar
    5 years ago

    Hi, jmcph 

     

    You may create measures as below. The pbix file is attached in the end.

     

    EcoAmt = 
    CALCULATE(
        SUM('Table'[Amt]),
        FILTER(
            'Table',
            [Book]="Eco"
        )
    ) 
    ProAmt = 
    CALCULATE(
        SUM('Table'[Amt]),
        FILTER(
            'Table',
            [Book]="Pro"
        )
    ) 

     

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly