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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mhirczi
Regular Visitor

Gantt Chart Visual Matrix - filter columns and rows with one slicer

Hello,

I'm new to Power BI and need some help for the problem I'm facing with filtering.

 

I've created a gantt chart using the visual matrix to show our audit program. The requirement is to filter the rows and columns with one slicer.

The slicer I use is related to the table audits 

mhirczi_4-1675942498146.png   

mhirczi_5-1675942559719.png

 

I've managed to achive the values with following measure:

MeasureGantt(0/1) =

VAR AuditDate_From = SELECTEDVALUE(Audits[From]) <= MAX (DateTable[Date])
VAR AuditDate_To = SELECTEDVALUE(Audits[To]) <= MAX (DateTable[Date])

VAR AuditStatus = CALCULATE(MIN(Audits[State]), REMOVEFILTERS('DateTable'))
VAR AuditDate = CALCULATE(SELECTEDVALUE(Audits[From]) <= MAX (DateTable[Date]) && SELECTEDVALUE(Audits[To]) >= MIN (DateTable[Date]))

VAR StatusResult =
SWITCH(
    TRUE(),
    AuditDate && AuditStatus = "Open", 1,
    AuditDate && AuditStatus = "Closed", 2
)
Return
IF(AuditDate,StatusResult,0)
 

The result is as expected:

mhirczi_0-1675941395232.png

 

The problem I have is that the visual does not filter the columns based on the filter selection. If I select only year 2022 only the rows are selected but the column for 2023 are still displayed.

mhirczi_1-1675941548360.png

 

My second idea was to change the measure so that no zero values are displayed. I've change the measure to return the variable StatusResult as result.

 

 

 

In this case only columns with values are displayed when I use the filter:

mhirczi_2-1675941751516.png

I know that the visual has the possibility to drill down eacht year seperatley. But what we want to achieve is that the user selects the year (or multiple years) in the slicer and no further user action is required. 

The filter result should look like this:

mhirczi_3-1675941965621.png

I hope anyone can help with this.

 

 

0 REPLIES 0

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.