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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Neiltc
Frequent Visitor

Data formatting with date

I am trying to create a graphic that shows data for projects where the projects and within time, almost due or overdue and then display this in a graph, pie chart etc but im struggling with the formatting. has anyoine else tried this?

1 ACCEPTED SOLUTION

OK assuming you have a table Proj like this:

ProjectDueActual
A8/1/20177/30/2017
B8/1/20178/10/2017
C8/1/20178/5/2017
D8/1/20178/10/2017

 

 

Add two calculated columns to Proj:

Diff = IF(Proj[Due] > Proj[Actual],
          -DATEDIFF(Proj[Actual], Proj[Due], DAY),
          DATEDIFF(Proj[Due], Proj[Actual], DAY))

Status = IF(Proj[Diff] > 6,
            "Overdue",
            IF(Proj[Diff] > 0,
               "Delayed",
               "On Time"))

You can now easily display a simple table visual:

image.png

by placing the columns of Proj like this and chnaging the data colors appropriately:

image.png

View solution in original post

3 REPLIES 3
erik_tarnvik
Solution Specialist
Solution Specialist

Can you provide some more specifics on your data tables and what you want the graph to look like?

Hi Erik,

I have an excel sheet with about 100 rows of current projects, each has a due date.  In excel i would use conditional formatting to show green if the projects were within delivery time, yellow if they were within 6 days of the due date and red if they were over the due date. I am looking for a way to graphically represent this, even a bar chart of the three categories but I am unsure of the query that is needed...

OK assuming you have a table Proj like this:

ProjectDueActual
A8/1/20177/30/2017
B8/1/20178/10/2017
C8/1/20178/5/2017
D8/1/20178/10/2017

 

 

Add two calculated columns to Proj:

Diff = IF(Proj[Due] > Proj[Actual],
          -DATEDIFF(Proj[Actual], Proj[Due], DAY),
          DATEDIFF(Proj[Due], Proj[Actual], DAY))

Status = IF(Proj[Diff] > 6,
            "Overdue",
            IF(Proj[Diff] > 0,
               "Delayed",
               "On Time"))

You can now easily display a simple table visual:

image.png

by placing the columns of Proj like this and chnaging the data colors appropriately:

image.png

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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