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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Hasna95
Frequent Visitor

Duration of Days - Bar Chart in Power BI

Hi. 
So I am facing this issue, and I have not seen it anywhere. 
I basically have this table : 

PR NumberDepartmentPR StatusYearVendorDatePR Raised byPR Approved Date(LM)PR Approved Date(Procurement)SLA MetPurchase TypePR Order Creation Date
PR0001ProcurementOpen2024Vendor 119/06/2024John22/06/202422/07/2024NoRFP23/07/2024
PR0002OperationsOpen2024Vendor 231/01/2024Alice03/02/202428/02/2024NoRFQ29/02/2024
PR0003FinanceClosed2024Vendor 301/02/2024Bob10/02/202410/03/2024NoException10/03/2024
PR0004MarketingClosed2024Vendor 407/02/2024Carol15/02/202416/02/2024YesException18/02/2024
PR0005ITOpen2024Vendor 515/02/2024David18/02/202418/03/2024NoRFP

19/03/2024


I have 3 durations, I would like to show: 
1. Duration of days from Date to PR Approved Date (LM)
2. Duration of days from PR Approved Date (LM) to PR Approved Date (Procurement)
3. Duration of days from PR Approved Date (Procurement) to PR order Creation Date

I want to show these durations for each Purchase Type
Example: RFQ, RFP, and Exception.

So when I filter through Department or PR number, I can know what was all the 3 durations for each Purchase Type. 

I want something like this: 

Hasna95_0-1709284245408.png


I know I can recreate it bar chart or a matrix visual. But the issue I am facing is that, I have 3 durations for each Purchase Type. 
That's why it's not coming the way I want it to. 

Can you anyone suggest what I can do? 

7 REPLIES 7
Hasna95
Frequent Visitor

I did all that. 
I have this formula 

OverallStartDate Trial Measure =
MINX(
    SUMMARIZE(Trial, Trial[PR Number], "MinStartDate", MIN(Trial[MinStartDate])),
    [MinStartDate]
)
and this
Bar Shifting Days = SWITCH( TRUE(), Trial[Interval] = "LM Approved", Trial[Duration], Trial[Interval] = "Procurement Approved", DATEDIFF(Trial[From], Trial[To], DAY), Trial[Interval] = "Closed", DATEDIFF(Trial[From], Trial[To], DAY), BLANK() )

the issue is, if Closed is 1, instead of coming after the Procurement Approved It comes right under 0. 
Hasna95_0-1709724077246.png

Closed should come after Procurement Approved. 
I hope I am making sense.

 



and for duration, I have this formula. 

Duration = DATEDIFF('Table Demo'[From], 'Table Demo'[To], DAY)

After transforming the table, this is how it is structured. 
Hasna95_0-1709728311230.pngHasna95_1-1709728330297.png

 

Hasna95
Frequent Visitor

What I am looking for is basically, for each PR Number, I need to see the duration days from LM Approved, Procurement Approved and PO Creation Date (Clsoed)
I don't need the dates. I need the duration days rather similar to a gantt chart. But not sure how to structure my table. 

You can get that by summing the differences between From and To.

lbendlin
Super User
Super User

First step is to bring the data into a usable format

 

Project Purchase Type Interval type From To

 

Then use custom visuals like Deneb to show multiple date ranges in the same bar chart.

I'm not too sure if I understand you. 

Your data is not in a usable format.  It is coming from Excel where wide tables with many columns are common.  Power BI expects narrow tables with limited number of columns.  Unpivot your data with the headers that I suggested, or your own choice of headers. 

 

lbendlin_0-1709404373876.png

Then use Deneb to plot the data

 

lbendlin_1-1709404730871.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors