Forum Discussion

Johan's avatar
Johan
Advocate II
8 years ago
Solved

All() dax not working

I know this issue has been raised before in the forum, but still I cannot get it to work. I've got the most simple example: 3 tables: products, orders and calendar. products have a status there a...
  • MFelix's avatar
    MFelix
    8 years ago

    Hi Johan,

     

    Create a table with status:

     

    Status

    Open
    Planned

    Production

     

    Then make an inactive relationship between Status table and Products Table:

     

    Change your two measure to the following code:

    Ordered last year =
    CALCULATE ( SUM ( Orders[Ordered qty.] ); 'Calendar'[YearsAgo] = 1 )
    
    Ordered this year =
    CALCULATE (
        SUM ( Orders[Ordered qty.] );
        'Calendar'[YearsAgo] = 0;
        USERELATIONSHIP ( 'Status'[Status]; Products[Status] )
    )

    Now use the Status table on your slicer and everything should work as you want:

     

    Regards,

    MFelix