Forum Discussion

trdoan's avatar
trdoan
Helper III
7 years ago
Solved

DAX in a Chart

Hello everyone,   My sample data can be found here   Assuming I have a "Store Name" slicer made from 'General Info'[Store Name] and a random store name is selected, I'd like to use the following ...
  • v-yulgu-msft's avatar
    7 years ago

    Hi trdoan ,

     

    An extra year dimention table is needed, which is linked to both 'Global Sales' and 'W Sales' tables based on common field [Year].

    Year = VALUES('Global Sales'[Year])

     

    Add [Store Name] from the 'General Info' into slicer. Place [Year] from above calculated table 'Year' onto X-axis, and add below measures into "values" of chart.

    Global sales measure =
    IF (
        ISFILTERED ( 'General Info'[Store Name] ),
        SUM ( 'Global Sales'[Global Sales] ),
        BLANK ()
    )
    
    W sales measure =
    IF (
        ISFILTERED ( 'General Info'[Store Name] ),
        SUM ( 'W Sales'[W Sales] ),
        BLANK ()
    )
    

    Best regards,

    Yuliana Gu