Forum Discussion

manuellchavez's avatar
manuellchavez
Icon for Advocate I rankAdvocate I
6 years ago
Solved

DAX Measure - Ignore specific filter but keep some others

Hello,

I am trying to create a visual similar to the one below:


The first measure is something like this:
Quantity = calculate(sum(quantity),filter(colortable, colortable[date]=max(masterdate[date])))
Then I add the color names from a column in the dataset.
This calculation is correct.
Now I want to add the total for that date regardless the color in a new column for the same visual using another measure, does anyone know how to keep the date filter in that measure, but skip the color name?

Note: I dont want to move any of the three measures to calculated columns, just keep them as measures.

  • AlB's avatar
    AlB
    6 years ago
    Quantity =
    CALCULATE (
        SUM ( colortable[quantity] ),
        FILTER ( ALL( colortable[date] ), colortable[date] = MAX ( masterdate[date] ) ),
        ALL ( colortable[color] )
    )

    If this doesn't work do share the pbix or at least a sample of your tables (in text-tabular format, not screen capture)

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

4 Replies

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi manuellchavez 

    You'd just need an ALL on the colour column:

    Quantity =
    CALCULATE (
        SUM ( colortable[quantity] ),
        FILTER ( colortable, colortable[date] = MAX ( masterdate[date] ) ),
        ALL ( colortable[color] )
    )

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

    • manuellchavez's avatar
      manuellchavez
      Icon for Advocate I rankAdvocate I

       Thanks for the response AlB , unfortunatelly it is still not showing the total sum on each row, just the total for each color.

      • AlB's avatar
        AlB
        Icon for Community Champion rankCommunity Champion
        Quantity =
        CALCULATE (
            SUM ( colortable[quantity] ),
            FILTER ( ALL( colortable[date] ), colortable[date] = MAX ( masterdate[date] ) ),
            ALL ( colortable[color] )
        )

        If this doesn't work do share the pbix or at least a sample of your tables (in text-tabular format, not screen capture)

         

        Please mark the question solved when done and consider giving kudos if posts are helpful.

        Cheers  Datanaut