Forum Discussion

Hemanth96's avatar
Hemanth96
Frequent Visitor
3 years ago
Solved

Return Text column based on other column condition

Hi, I'm a noobie to DAX and need help. I have a table with product names and store wise sales.   I want to see a visual matrix table where the prodnames should be displayed if either store 1 or sto...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Hemanth96 ,

     

    Here I suggest you to create measures by dax and add measures into visual level filter to filter your visual.

    Measure is based on your table.

    Table1:

    Measure 1 = 
    IF(ISBLANK(SUM('Table'[store1]))&& ISBLANK(SUM('Table'[store2])),0,1)

    Table2:

    Measure 2 = 
    VAR _STORE1 = CALCULATE(SUM('Table (2)'[Value]),FILTER('Table (2)','Table (2)'[Attribute] = "store 1"))
    VAR _STORE2 = CALCULATE(SUM('Table (2)'[Value]),FILTER('Table (2)','Table (2)'[Attribute] = "store 2"))
    RETURN
    IF(ISBLANK(_STORE1)&&ISBLANK(_STORE2),0,1)

    Create visual by columns , add measure into visual level filter and set it to show items when value =1.

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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