Forum Discussion

Binkhorst's avatar
Binkhorst
Frequent Visitor
5 years ago
Solved

Function ALL does not work if the column is sorted by another column.

I have a fact table and a date table.  In the date table I have a column for the MonthName. This is a tekst column so I have sorted it by the MonthNumber column to correctly order the months. 

 

I want to calculate an amount in my fact table where I want to ignore the filter on the MonthName. I have used the function ALL for this. However the function does not work when I sort the MonthName by the MonthNumber column. If I do not sort the MonthName then the function works as expected.

 

Is there a work around for this?

  • MFelix's avatar
    MFelix
    5 years ago

    Hi Binkhorst ,

     

    You can and you must use the Month Name on your reports on your measure you must use the MonthNumber.

     

    The calculations in measures is based on context so if you pickup a column from a table, in this case Month Name, all the other columns in the same row are pickup based on context also so the Month Name is pick up for your visualizaiton and by the row context the month number is pickup and used in your measure so everything will work properly.

     

    There is no need to use only the columns you use on your measure in the visualization the context transcition make it work properly.

4 Replies

  • Hi Binkhorst ,

     

    In this case you should always use your base column on your all function, for you model instead of using the

    ALL(Table[MonthName])

     

    You should use the 

    ALL(Table[Month])

     

    Since this is in the same table and row the result is the same.

    • Binkhorst's avatar
      Binkhorst
      Frequent Visitor

      Thank you for your input.  That would mean I cannot use MonthName in my reports and I hoped there would be another solution.

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        Hi Binkhorst ,

         

        You can and you must use the Month Name on your reports on your measure you must use the MonthNumber.

         

        The calculations in measures is based on context so if you pickup a column from a table, in this case Month Name, all the other columns in the same row are pickup based on context also so the Month Name is pick up for your visualizaiton and by the row context the month number is pickup and used in your measure so everything will work properly.

         

        There is no need to use only the columns you use on your measure in the visualization the context transcition make it work properly.