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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Problem with Week Num in Gantt Chart using Matrix

Hi, I have a problem with the customized Gantt using Matrix that are wrongly plotted in the Week Number portion.

Given with the Date and the Projects Table respectively,

PowVizual_0-1651630719230.png     PowVizual_1-1651630739451.png

projects 1 through 7 should belong to week 1, projects 8 through 14 should belong to week 2 and only project 15 is starting on week 3.

 

However, when I started to plot them into the matrix with the measure to plot the dates,

PowVizual_2-1651631014715.png

I get the undesired plot in my Matrix chart.

PowVizual_3-1651631172519.png

 

Is there something I miss with my measure or with how the date table is coded?



1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Can't quite see what your problem is, but you can refer to my method and it works fine. 

A calendar table has no relationship between fact table. I think this is what @amitchandak means.

New measure to identify if the day contained in that week.

Measure =
VAR _p_d =
    CALENDAR ( MAX ( 'Table'[start date] ), MAX ( 'Table'[end date] ) )
VAR _c_d =
    VALUES ( 'calendar'[Date] )
VAR _if_in =
    COUNTROWS ( _p_d ) - COUNTROWS ( EXCEPT ( _p_d, _c_d ) )
RETURN
    IF ( _if_in > 0, 1 )

vchenwuzmsft_0-1651830738183.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

PowVizual_0-1651640220181.png

 It seems that this a bug from power bi

 

Hi @Anonymous ,

 

Can't quite see what your problem is, but you can refer to my method and it works fine. 

A calendar table has no relationship between fact table. I think this is what @amitchandak means.

New measure to identify if the day contained in that week.

Measure =
VAR _p_d =
    CALENDAR ( MAX ( 'Table'[start date] ), MAX ( 'Table'[end date] ) )
VAR _c_d =
    VALUES ( 'calendar'[Date] )
VAR _if_in =
    COUNTROWS ( _p_d ) - COUNTROWS ( EXCEPT ( _p_d, _c_d ) )
RETURN
    IF ( _if_in > 0, 1 )

vchenwuzmsft_0-1651830738183.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , I such cases it is always better to use an independent date table

 

Matrix as Project plan Visual: https://youtu.be/R25QoiyoSVs

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

What do you mean by independent date table?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.