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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
shivendr
Helper I
Helper I

Gannt Chart : Timeline in Daily, weekly and Monthly basis Just like in Excel

Hi ,

I am replicating gannt chart for Project tracking from excel to Power BI, I am facing difficulty in showing timeline of Gannt Chart in Three ways like : Daily, weekly and monthly as the option we have in Excel.

For Gannt Chart in Power BI, I am using Custom Visual by Microsoft.
Here is the example in power bi currently Screenshot 2023-09-25 123655.jpg

Example in Excel : Screenshot 2023-09-25 123756.jpg
Based on the selection in slicer I want to change the timeline in Gannt Chart.

Looking for solution, Thanks in advance!

2 REPLIES 2
devesh_gupta
Super User
Super User

@shivendr 

To create a Gantt chart with the ability to switch between daily, weekly, and monthly views in Power BI, you'll need to utilize slicers and measures to dynamically adjust the date granularity. Here's how you can achieve this:

  1. Set Up Your Data:

    • Make sure you have a table with columns for Task Name, Start Date, and End Date.
  2. Create a Date Table:

    • In Power BI, you'll often need a dedicated date table. If you haven't created one yet, you can do so using Power Query or DAX functions. This table should cover a wide range of dates.
  3. Create Slicers:

    • Create two slicers: one for selecting the view (Daily, Weekly, Monthly) and one for selecting the date range.
  4. Create Measures:

    • Create measures to dynamically adjust the date granularity based on the selected view. Here's an example for Daily view:

 

Gantt Start Date = 
IF (
    SELECTEDVALUE ( 'Slicer View' ) = "Daily",
    MIN ( 'Date Table'[Date] ),
    IF (
        SELECTEDVALUE ( 'Slicer View' ) = "Weekly",
        MIN ( 'Date Table'[Date] ),
        IF (
            SELECTEDVALUE ( 'Slicer View' ) = "Monthly",
            MIN ( 'Date Table'[Date] ),
            BLANK ()
        )
    )
)
​

 

  • This measure checks the selected view and returns the minimum date in the date table. Adjust this measure for weekly and monthly views.
  • Create Gantt Chart: Use the Gantt chart custom visual by Microsoft. Assign the Task Name to the "Task" field, Gantt Start Date to "Start", and End Date to "End".

 

If you find this insightful, please provide a Kudo and accept this as a solution.

Hi Devesh,

Appreciate your help, but the above dax is creating a measure which is not usable either in slicer or Gannt Chart.
Can you refer any video related to the solution?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.