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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Gantt Matrix Filter out zero rows

I have a problem visualising production plan.

Here is the data example:

ProductProduction StartProduction End
111115/09/202327/09/2023
111218/09/202328/09/2023
111320/09/2023 02/10/2023
111422/09/202304/10/2023
111526/09/2023 10/10/2023
111628/09/202312/10/2023
111702/10/2023 16/10/2023
111804/10/202318/10/2023
111910/10/2023 20/10/2023
112012/10/202324/10/2023

 

My aim is to show the products that are on the poroduction line during next two weeks. 

I created Gnatt Chart using matrix with this Measure:

Gantt Measure =
VAR _DATE = MIN('Working Days'[Day])
VAR Start = MIN(PDP[Production Start])
VAR End = MAX(PDP[Production End])
RETURN
    SUMX(VALUES(Table[Product]), IF(AND(_DATE>=Start, _DATE<=End), 1, 0))
 
The Masure works, but I got huge table containing all the products that were or will be produced in the next two years.
I tried to filter this by putting in filter area Gantt Measure = 1. But in this case it shows only the poducts that have measuse equal 1 on the first day of the selected period.
 Here is what I get:
viviva_0-1696434297266.png

And here is what I suppose to get:

viviva_1-1696434414608.png

 

I assume thats because if incorrect totals, and tried to implement the solution from this post Measure Totals, The Final Word - Microsoft Fabric Community :

I created another measure to be put in the filter. But the result is the same as before
Gantt Totals =
VAR __table = SUMMARIZE('TAble',[Product,"__value",[Gantt Measure])
RETURN
IF(HASONEVALUE(Table[Product]),[Gantt Measure],SUMX(__table,[__value]))
 
Could you please advice me what am I doing wrong here, and how ro resolve it?
Thanks!
 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I managed to resolve the issue by myself with separate measure that I used to filter out the products that currently in production:

_Current =
VAR PeriodStart = CALCULATE(
    MIN(Calendario[Dias de Trabalho] ),
    ALLSELECTED( Calendario[Dias de Trabalho] )
    )
VAR PeriodEnd = CALCULATE(
     MAX(Calendario[Dias de Trabalho] ),
     ALLSELECTED( Calendario[Dias de Trabalho] )
    )
VAR Start = MIN(PDP[Entrada na Linha])
VAR End = MIN(PDP[Saida da Linha])
RETURN IF(
    AND(Start>=PeriodStart, Start<=PeriodEnd) ||
    AND(End>=PeriodStart, End<=PeriodEnd) ||
    AND(Start<=PeriodStart, End>=PeriodEnd),
    1,0)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I managed to resolve the issue by myself with separate measure that I used to filter out the products that currently in production:

_Current =
VAR PeriodStart = CALCULATE(
    MIN(Calendario[Dias de Trabalho] ),
    ALLSELECTED( Calendario[Dias de Trabalho] )
    )
VAR PeriodEnd = CALCULATE(
     MAX(Calendario[Dias de Trabalho] ),
     ALLSELECTED( Calendario[Dias de Trabalho] )
    )
VAR Start = MIN(PDP[Entrada na Linha])
VAR End = MIN(PDP[Saida da Linha])
RETURN IF(
    AND(Start>=PeriodStart, Start<=PeriodEnd) ||
    AND(End>=PeriodStart, End<=PeriodEnd) ||
    AND(Start<=PeriodStart, End>=PeriodEnd),
    1,0)

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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