Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I’m trying to build to custom “Gantt Chart” as shown below using the native Matrix visual (do not want to use external visuals nor Microsoft Gantt Chart).
What I’m trying to do is, if a particular task / activity has a start date (i.e. 30/07/2022) that is <= today(), then give me a 1, that is plotted on the matrix, which using the example should plot 1 next to the activity in 2022 July and 2022 August.
Similarly, if the activity has end_date that is > today() then give me a 2, that is plotted on the matrix, otherwise if the activity hasn’t started then give me a 0.
My current dax is as below:
VAR Start_date =
CALCULATE(
MIN(Task_All[___START_DATE]),
REMOVEFILTERS(FinishCalendar)
)
VAR End_Date =
CALCULATE(
MAX(Task_All[___END_DATE]),
REMOVEFILTERS(FinishCalendar)
)
VAR Min_date = MIN(FinishCalendar[Date])
VAR ProjectPeriod =
Min_date >= Start_date
&& Min_date <= End_Date
VAR ProjectStatus =
CALCULATE(
MIN(Task_All[___IsDelivered]),
REMOVEFILTERS(FinishCalendar[Date])
)
RETURN
SWITCH(
TRUE(),
ProjectPeriod && FILTER(Task_All,Task_All[___START_DATE] <=TODAY()), 1,
ProjectPeriod && FILTER(Task_All,Task_All[___END_DATE] > TODAY()), 2,
0
)
Is that the full measure code? What is ProjectStatus used for?
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |