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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power Query

Below is the Input

mandarmanik1_0-1668595696032.png

Below is the Output

mandarmanik1_1-1668595731172.png

 

Would this even be possible using Power Query?

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

In the matrix view of Desktop, you can output the results you expect.

Column:

End Date = [Start Date]+[Days Booked]

Create a new date table.

Date = CALENDAR(MIN('Table'[Start Date]),MAX('Table'[End Date]))

Column:

Weekday = FORMAT([Date],"dddd")

vzhangti_0-1668674900547.png

Measure = 
IF (
    SELECTEDVALUE ( 'Date'[Weekday] ) = "Saturday",
    BLANK(),
    IF (
        SELECTEDVALUE ( 'Date'[Weekday] ) = "Sunday",
        BLANK(),
        CALCULATE (
            MAX ( 'Table'[Project Name] ),
            FILTER (
                ALL ( 'Table' ),
                [Start Date] <= SELECTEDVALUE ( 'Date'[Date] )
                    && [End Date] >= SELECTEDVALUE ( 'Date'[Date] )
                    && [Staff Name] = SELECTEDVALUE ( 'Table'[Staff Name] )
            )
        )
    )
)

vzhangti_2-1668675379359.png

Measure:

Color = SWITCH(TRUE(),
SELECTEDVALUE('Table'[Project Name])="ABC Pte Ltd","Yellow",
SELECTEDVALUE('Table'[Project Name])="DEF Pte Ltd","light gray",
SELECTEDVALUE('Table'[Project Name])="GHI Pte Ltd","blue",
SELECTEDVALUE('Table'[Project Name])="JKL Pte Ltd","gray")

vzhangti_3-1668675426988.pngvzhangti_4-1668675438956.pngvzhangti_5-1668675452053.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

In the matrix view of Desktop, you can output the results you expect.

Column:

End Date = [Start Date]+[Days Booked]

Create a new date table.

Date = CALENDAR(MIN('Table'[Start Date]),MAX('Table'[End Date]))

Column:

Weekday = FORMAT([Date],"dddd")

vzhangti_0-1668674900547.png

Measure = 
IF (
    SELECTEDVALUE ( 'Date'[Weekday] ) = "Saturday",
    BLANK(),
    IF (
        SELECTEDVALUE ( 'Date'[Weekday] ) = "Sunday",
        BLANK(),
        CALCULATE (
            MAX ( 'Table'[Project Name] ),
            FILTER (
                ALL ( 'Table' ),
                [Start Date] <= SELECTEDVALUE ( 'Date'[Date] )
                    && [End Date] >= SELECTEDVALUE ( 'Date'[Date] )
                    && [Staff Name] = SELECTEDVALUE ( 'Table'[Staff Name] )
            )
        )
    )
)

vzhangti_2-1668675379359.png

Measure:

Color = SWITCH(TRUE(),
SELECTEDVALUE('Table'[Project Name])="ABC Pte Ltd","Yellow",
SELECTEDVALUE('Table'[Project Name])="DEF Pte Ltd","light gray",
SELECTEDVALUE('Table'[Project Name])="GHI Pte Ltd","blue",
SELECTEDVALUE('Table'[Project Name])="JKL Pte Ltd","gray")

vzhangti_3-1668675426988.pngvzhangti_4-1668675438956.pngvzhangti_5-1668675452053.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

Anonymous
Not applicable

Thanks so much!

ddpl
Solution Sage
Solution Sage

@Anonymous 

 

You should try Gantt Chart, which you will get in Power BI in Get more visuals Section.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.