Forum Discussion

tamiribas's avatar
tamiribas
Resolver I
2 years ago
Solved

Using a disconnected table to achieve partial visual interaction

Hi,   We have a Bar Chart, a Matrix and a Year Slicer on the same page. Both Bar Chart and Matrix are showing [SalesAmount] by Category and YearMonths. In the bar chart, the categories are in the...
  • tamiribas's avatar
    tamiribas
    2 years ago

    Here is a link to a PBIS with the correct functionality.

    https://drive.google.com/file/d/1Gh7yBEZcwZJfbQKwgEr5N4DBy7Re3_md/view?usp=drive_link

     

    The date slicer is taken from the disconnected dim table.

    The date in the Barchart is taken from the dim date table.

    The date in the Matrix is taken from the disconnected dim table.

     

    I adjusted the measure in the Barchart so that :

    SalesAmountInBarChart = 
    VAR _MinSelected = MIN('dimDateDisconnected'[YearMonth])
    VAR _MaxSelected = MAX('dimDateDisconnected'[YearMonth])
    VAR _CalcSales = 
    IF (
         SELECTEDVALUE('dimDate'[YearMonth])>=_MinSelected && SELECTEDVALUE('dimDate'[YearMonth])<=_MaxSelected,
          [SalesAmount],BLANK()
    )
    RETURN
    _CalcSales

     

    The measure in the Matrix:

    SalesAmountInMatrix = 
    CALCULATE(
        [SalesAmount],
        TREATAS(
            VALUES(dimDateDisconnected[YYYY/MM]),
            factSales[YYYY/MM]
            ),
            ALL(dimDate[YYYY/MM])
    )