Forum Discussion

meirlicht's avatar
meirlicht
Frequent Visitor
2 years ago
Solved

DAX ALL() not working

I am trying to filter out items that only have 1 unit price. I created the following measure which is supposed to return the number of distinct unit prices, ignoring table filters. Distinct Co...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi meirlicht ,

    You can optimize your Dax performance with this code:

     

    Distinct Count of Price 2.0 = 
    CALCULATE (
        COUNTROWS ( DISTINCT ( 'SalesData'[Unit Price] ) ),
        ALLEXCEPT ( 'SalesData', 'SalesData'[Code], 'SalesData'[Store] )
    )
    

     

     

    Final output:

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Ada Wang

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