Forum Discussion
Anonymous
2 years agoNot applicable
Gantt Matrix Filter out zero rows
I have a problem visualising production plan.
Here is the data example:
| Product | Production Start | Production End |
| 1111 | 15/09/2023 | 27/09/2023 |
| 1112 | 18/09/2023 | 28/09/2023 |
| 1113 | 20/09/2023 | 02/10/2023 |
| 1114 | 22/09/2023 | 04/10/2023 |
| 1115 | 26/09/2023 | 10/10/2023 |
| 1116 | 28/09/2023 | 12/10/2023 |
| 1117 | 02/10/2023 | 16/10/2023 |
| 1118 | 04/10/2023 | 18/10/2023 |
| 1119 | 10/10/2023 | 20/10/2023 |
| 1120 | 12/10/2023 | 24/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:
And here is what I suppose to get:
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!
- Anonymous2 years ago
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)
1 Reply
- AnonymousNot 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)