Forum Discussion
OKgo
2 years agoHelper IV
Gantt Chart with Matrix Visual
Saw this cool post and decided to try it out https://www.linkedin.com/posts/basdohmen_powerbi-design-activity-7172551962473795584-fPP_?utm_source=share&utm_medium=member_desktop I got very close...
- 2 years ago
OKgo OK, this worked for me. PBIX is attached below signature:
Gantt = VAR StartDate = CALCULATE( MIN(Batches[Manufacturing Date]), ALLEXCEPT('Batches','Batches'[Status]) ) VAR EndDate = CALCULATE( MIN(Batches[Labelled Expiry]), ALLEXCEPT('Batches','Batches'[Status]) ) VAR CalendarStart = MIN('Calendar'[Date]) VAR CalendarEnd = MAX('Calendar'[Date]) VAR ProjectPeriod = IF( CalendarStart >= StartDate && CalendarEnd <= EndDate, 1, 0 ) VAR ProjectStatus = CALCULATE( MIN(Batches[Status]), ALLEXCEPT('Batches','Batches'[Status]) ) VAR Result = IF( ProjectPeriod = 0, BLANK(), SWITCH( TRUE(), ProjectStatus = "Manufactured", 1, ProjectStatus = "Plan", 2, ProjectStatus = "Cancelled", 3 ) ) RETURN Result
Greg_Deckler
2 years agoCommunity Champion
OKgo OK, this worked for me. PBIX is attached below signature:
Gantt =
VAR StartDate =
CALCULATE(
MIN(Batches[Manufacturing Date]),
ALLEXCEPT('Batches','Batches'[Status])
)
VAR EndDate =
CALCULATE(
MIN(Batches[Labelled Expiry]),
ALLEXCEPT('Batches','Batches'[Status])
)
VAR CalendarStart = MIN('Calendar'[Date])
VAR CalendarEnd = MAX('Calendar'[Date])
VAR ProjectPeriod = IF( CalendarStart >= StartDate && CalendarEnd <= EndDate, 1, 0 )
VAR ProjectStatus =
CALCULATE(
MIN(Batches[Status]),
ALLEXCEPT('Batches','Batches'[Status])
)
VAR Result =
IF(
ProjectPeriod = 0, BLANK(),
SWITCH(
TRUE(),
ProjectStatus = "Manufactured", 1,
ProjectStatus = "Plan", 2,
ProjectStatus = "Cancelled", 3
)
)
RETURN
ResultOKgo
2 years agoHelper IV
Firstly fantastic filename!
The issue was the cross filter direction. You had set this to single and it worked when I applied the same logic to my model it worked. Thank you so much. This is for sure something I will read up more on.
- Greg_Deckler2 years agoCommunity Champion
OKgo Lol! Yeah, that was definitely not a typo! Glad you got it figured out!