Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

All() not working properly

Hi, 

I'm not sure if this is a known bug or issue, but I have seen some examples of it in the past on the forums but without much being resolved. 

In short, I have a table for returns. I create a column (in power query or dax) called Owned, which returns a 1 if a separate column contains a string "31", or 0 if it doesnt. Really simple. 

The issue comes when I create a measure sumqty. It sums the qty field in the same table, but wants to do that irrespective of the filter selection on Owned, so I use ALL('table'[Owned]). However, when I apply a filter to said column, I receive a number that makes no sense. This also only breaks if I have a separate filter going onto the same table, but that really shouldn't make a difference based on the measures. 

Anyone experience this before? This seems 100% like a bug but I reached out to Microsoft support and they said they couldn't help as I didn't receive an error. 

This is the ONLY table I have in the model. 

Attached are some pictures. Here you can see no filter selected for Owned QtyHere a filter is selected for Owned of 0, which returns the expected resultSelecting Owned = 1 returns an unexpected result

 

 

7 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous 

    Can you share the pbix?

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      How should I share it? I cant attach it in this comment. 

  • AlB's avatar
    AlB
    Community Champion

    You have to share the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like tinyupload.com (no sign-up required).

     

    Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

     

  • v-easonf-msft's avatar
    v-easonf-msft
    Community Support

    Hi, Anonymous 

    It is really weird, everything is fine on my side.

    Maybe you can try formula as below:

    SumQty =
    CALCULATE (
        SUM ( 'Master Returns Table'[quality] ),
        REMOVEFILTERS ( 'Master Returns Table'[Owned] )
    )
    

    Best Regards,
    Community Support Team _ Eason

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yeah, I've tried removefilters() and that doesnt work either.