Forum Discussion

sonali_powerbi's avatar
sonali_powerbi
Regular Visitor
10 years ago
Solved

stacked column display does not change with slicer

Hello,    I have a slicer that I would like to control two charts: a stacked bar chart, and a clustered bar chart. I only want to display the latest 12 months data. The clustered bar chart behaves ...
  • Anonymous's avatar
    Anonymous
    10 years ago

    Hi sonali_powerbi,

     

    >> So if I have a similar table B, I cannot link YearMonth columns in the two tables, as it will be a many-many connection.

     

    I’d like to suggest you use CALENDAR function to add ‘CALENDAR’ table to link other tables which contains the data column.

     

    Below is the Sample:

     

    1. Build two tables to test.

     

    ‘DateAmount’

     

    ‘MasterYearMonth’

     

    2. Add a calendar Table with date from above tables, and create relationships among those tables. (Since both tables contain the duplicate records, it’s not able to build a relationship.)

     

    Dax:  CALENDARTable = CALENDAR(MIN(MIN(DateAmount[Date]),MIN(MasterYearMonth[Date])),MAX(MAX(DateAmount[Date]),MAX(MasterYearMonth[Date])))

     

     

    Create the relationship:

     

     

    3. Use Calendar table to filter the records.(Below is the visual’s struct and screenshots)

     

    Stacked bar chart:

     

    Clustered bar chart:

     

     

    Slicer:

     

     

    Use slicer to filter both table:

     

    If above is not help, please provide more detial and feel free to let me know.

    Regards,

    Xiaoxin Sheng