Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tamiribas
Resolver I
Resolver I

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 legends, and the YearMonth on the X-Axis.

In the Matrix, the categories are in the rows, and the YearMonth on the Columns.

tamiribas_0-1722055638493.png

 

When selecting a data point from the bar chart, we need the table to display the results for the selected category but keep the columns of all the months that are in the selected Year Slicer. 

 

We tried the Disconnected dimDate approach:

tamiribas_1-1722055747511.png

 

Please see attached PBIX. 

Test Dates with disconnected tables 

 

we need help with the measure we show in the Matrix. This is the code so far (which ignores the year from the slicer and the corresponding Month in the column):

 

 

SalesAmountInMatrix2 = 
CALCULATE(
    [SalesAmount],
        TREATAS(
        VALUES('dimDate'[YYYY/MM]),
        'dimDateDisconnected'[YYYY/MM]
    )
)

 

 

 

Any help would be appreciated,

Thank you,

Tamir

1 ACCEPTED SOLUTION

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])
)

View solution in original post

6 REPLIES 6
v-nuoc-msft
Community Support
Community Support

Hi @tamiribas 

 

Can you tell me if your problem is solved? If yes, please accept it as solution.

 

Regards,

Nono Chen

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])
)

Hi @tamiribas 

 

Thank you very much for your sharing, it will be of great help to others!

 

Regards,

Nono Chen

Hi Nono, changing to ALLSELECTED('dimDate'[YYYY/MM]) did not help.

I managed though to solve it by adjusting both the measure in the bar chart.

I will upload my solution.

Thank you,

Tamir

v-nuoc-msft
Community Support
Community Support

Hi @tamiribas 

 

It looks like you're trying to synchronize the bar chart selection with the matrix while leaving the YearMonth column unchanged according to the Year Slicer.

 

Try adjusting the measure to comply with the Year Slicer and show the correct month in the matrix.

 

SalesAmountInMatrix2 = 
CALCULATE(
    [SalesAmount],
    TREATAS(
        VALUES('dimDateDisconnected'[YYYY/MM]),
        'dimDate'[YYYY/MM]
    ),
    ALLSELECTED('dimDate'[YYYY/MM])
)

 

This measure uses to ensure that the YearMonth context from the slicer is respected, and to map the selected YearMonth values from the disconnected table to the main date table.

 

Regards,

Nono Chen

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

tamiribas
Resolver I
Resolver I

I believe I almost solved it...

I am still not 100% through...as it is not working when I add quarters and months to the slicer.

 

Here is my current solution:

 

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

 

[SalesAmount]
Is evaluated within the current filter context (Selected category from the bar chart, a year from the slicer)

The TREATAS propagates the YYYY/MM filter from the disconnected dimDate to the fact table.

TREATAS(
     VALUES(dimDateDisconnected[YYYY/MM]),
     factSales[YYYY/MM]
     )
filters the yyyy/mm in the fact table to match the month in the columns. This way, the measure is computed for each month.
ALL(dimDate[YYYY/MM])
Allow all the months in the selected year to be displayed and not filtered as in the chart.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.