cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
povversas
New Member

Interactions between Column Chart and Table

Hello,

 

Report description:

I have Rooms data, columns: [Room],[Status],[Status Start];[Status End];

image.png

I have Date table which has NO Relationship to Rooms Table.

 

There is a measure to count Rooms in Period per Status (link😞

CountPerPeriod2 = CALCULATE(COUNT(Table2[Room]);
FILTER(Table2; ([Status Start] <= LASTDATE('Date'[Date]) 
&& [Status End] > FIRSTDATE('Date'[Date]))))

 

And there are two visuals:

image.png

image.png

 

Problem and requirement:

When the specific date and status is selected in Chart, Table should show ony selected Rooms.

Now Table shows all Rooms for selected Status ignoring date filter:

image.png

I guess it is because Date and Rooms has NO Relationship.

But this measure requires NO Relationship.

Is it possible to overcome this issue?

 

1 ACCEPTED SOLUTION

@v-sihou-msft

Thank you for the guidance, your comment about Visual level filter helped.

However measure was not correct. This part in IfAvailable measure:

CALCULATE(MAX ( Table2[Status Start] ))

takes MAX of [Status Start], but in those cases then selected day has more than one room available MAX is wrong function to use.

 

I found simplier solution to this. In table create Visual level filter of the main measure and set it to "is not blank":

SolutionSolution

WorkingWorking

 

View solution in original post

3 REPLIES 3
v-sihou-msft
Microsoft
Microsoft

@povversas

 

Your measure is to calculate count of Vacant/Occupied rooms over a full calendar. It should not have relationship to Date table. So it will always ignore Date[Date] filter. In your scenario, you can create a measure to check if a room is available:

 

IfAvailable =
IF (
    CALCULATE ( MAX ( Table[Status_Start] ) ) < MAX ( date[date] )
        && CALCULATE ( MAX ( Table[Status_End] ) ) > MAX ( date[date] ),
    0,
    1
)

Then add a Visual Level filter on your table visual with above measure. Set IfAvailable is 1

 

 Regards,

@v-sihou-msft

Thank you for the guidance, your comment about Visual level filter helped.

However measure was not correct. This part in IfAvailable measure:

CALCULATE(MAX ( Table2[Status Start] ))

takes MAX of [Status Start], but in those cases then selected day has more than one room available MAX is wrong function to use.

 

I found simplier solution to this. In table create Visual level filter of the main measure and set it to "is not blank":

SolutionSolution

WorkingWorking

 

 @v-sihou-msft

Thank you for answer.

 

I created new measure:

IfAvailable = 
IF (
    CALCULATE ( MAX ( Table2[Status Start] ) ) < MAX ( 'Date'[Date] )
        && CALCULATE ( MAX ( Table2[Status End] ) ) > MAX ( 'Date'[Date] );
    0;
    1
)

Attached Visual filter to table:

Visual FilterVisual Filter

After this I don't get desired result:

Error in filterError in filter

 Table should show only one Row.

 

 

 

@v-sihou-msft can you recheck IfAvailable measure logic is it correct?

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors