Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Dax

Hi, I have a card and a table visual where I want to show the correct sales value. Have been stucked for few days. Hope someone can show me the solution for this...   For the card, if I filter BU...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

    First, you can create a calculated column to get only Brand A, B,C and D. Then create a measure to get the sum of sales. You can find all details in the attachment.

    Nbrand = IF(IFERROR(SEARCH(":",'Sales'[Brand]),0)=0,'Sales'[Brand],BLANK())
    Total sales = 
    VAR _selBrand=SELECTEDVALUE('Sales'[Nbrand])
    VAR _group=CALCULATE(MAX('Sales'[Group]),FILTER('Sales','Sales'[Brand]=_selBrand))
    RETURN
        CALCULATE(SUM('Sales'[Sales]),FILTER(ALL('Sales'),'Sales'[Group]=_group))

    Best Regards
    Community Support Team _ Rena Ruan
    If this post helps, then please consider Accept it as the solution to help the other members find it more.