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
Angelvan
Frequent Visitor

Scaffold Date in Power Bi

I posted a similar questin before but now I now the solution is to create a scaffolded data set but still don't know how to do it in Power Bi.

 

Can anyone help with the query below:

 

I want to be create a graph that shows open or active cases in a point of time.

I two tables: Cases and Master Date.

Cases have the following important fields:

Opened date – the date that a case was opened

Close date – the date that a case was closed

Master Date table has dates from 1/1/2019 until 31/12/2025. It is like a reference table.

This table is not related to my main table in any way.

 

I want to create a new column to define the relationship between the two and in the process create a new column which will give me many rows of data for each row to tell me the Active Date

 

e.g.

Case Ref

Open Date

Close Date

Active Date

A

12/03/2019

16/03/2019

12/03/2019

 

 

 

13/03/2019

 

 

 

14/03/2019

 

 

 

15/03/2019

 

 

 

16/03/2019

B

12/03/2019

15/03/2019

12/03/2019

 

 

 

13/03/2019

 

 

 

14/03/2019

 

 

 

15/03/2019

C

13/03/2019

15/03/2019

13/03/2019

 

 

 

14/03/2019

 

 

 

15/03/2019

 

 

I expect the expression is something like this

IF

Master Date [Date] >= Cases[Open On]

AND

Master Date [Date] <= Cases[Close Date] (And if Close Date is Null make it Today)

THEN

SET Active Date to Master Date??

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Have a look at this

https://community.powerbi.com/t5/Desktop/Calculate-DayNumber-between-Two-Dates/m-p/773693#M372773

There's a DAX solution, a Power Query solution and a pbix to look at.

It's a slightly different case to yours but you should get all the info you need

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

Have a look at this

https://community.powerbi.com/t5/Desktop/Calculate-DayNumber-between-Two-Dates/m-p/773693#M372773

There's a DAX solution, a Power Query solution and a pbix to look at.

It's a slightly different case to yours but you should get all the info you need

Thanks very much - this worked!

 

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.