Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Dynamic Filtering for each column for table

Hi 

I would like to calculate the value where one particular column should not be affected by one of the filter . 

Dataset - 


I would like to sum the number for each value present in Column1 - I have two filters (Color Code and Category)
The column with pink header should be calculated based on color code filter only.
The column with blue header should be calculated based on category code filter only.

Note - Numbers seen in the above table are wrong

Can someone please help me with the DAX?

Thank you in advance.






  • Hi,

    Please check the below picture and the attached pbix file.

     

     

    Base on color code: =
    CALCULATE (
    SUM ( Data[Number] ),
    TREATAS ( VALUES ( Color[Color Code] ), Data[Color Code] )
    )
     
    Base on category: =
    CALCULATE (
    SUM ( Data[Number] ),
    TREATAS ( VALUES ( Category[Category] ), Data[Category] )
    )
     

1 Reply

  • Hi,

    Please check the below picture and the attached pbix file.

     

     

    Base on color code: =
    CALCULATE (
    SUM ( Data[Number] ),
    TREATAS ( VALUES ( Color[Color Code] ), Data[Color Code] )
    )
     
    Base on category: =
    CALCULATE (
    SUM ( Data[Number] ),
    TREATAS ( VALUES ( Category[Category] ), Data[Category] )
    )