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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
skeebo
New Member

Create query for date scaffolding - Capacity/Utilization Visuals

Hello, I need to create a static table so I can make relationships to a dynamic set for various calculations.

 

I have created a query/table that generates the unique date values I need but can't figure out how to assign those dates to individual values from another query.

 

For example I have these resources with a value as it's capacity but I need the dates associated to them:

ResourceCapacity
A6
B7
C8

 

Date
4/16/2025
4/17/2025
4/18/2025
4/21/2025
4/22/2025

  The desired outcome would look like this:

DateResourceCapacity
4/16/2025A6
4/17/2025A6
4/18/2025A6
4/21/2025A6
4/22/2025A6
4/16/2025B7
4/17/2025B7
4/18/2025B7
4/21/2025B7
4/22/2025B7
4/16/2025C8
4/17/2025C8
4/18/2025C8
4/21/2025C8
4/22/2025C8

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

One way to do this to add a column to the date table that references the resource table. Expand that column and then sort as needed.
resourceTable

jgeddes_0-1744835399602.png

dateTable

jgeddes_1-1744835429084.pngjgeddes_2-1744835453767.pngjgeddes_3-1744835475546.pngjgeddes_4-1744835512884.png

Example code:

let
    resourceTable = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJTitWJVnICsszBLGcgy0IpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Resource = _t, Capacity = _t]),
    Source = List.Dates(#date(2025,4,16), 5, #duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each resourceTable),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Resource", "Capacity"}, {"Resource", "Capacity"}),
    #"Sorted Rows" = Table.Sort(#"Expanded Custom",{{"Resource", Order.Ascending}, {"Date", Order.Ascending}})
in
    #"Sorted Rows"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
jgeddes
Super User
Super User

One way to do this to add a column to the date table that references the resource table. Expand that column and then sort as needed.
resourceTable

jgeddes_0-1744835399602.png

dateTable

jgeddes_1-1744835429084.pngjgeddes_2-1744835453767.pngjgeddes_3-1744835475546.pngjgeddes_4-1744835512884.png

Example code:

let
    resourceTable = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJTitWJVnICsszBLGcgy0IpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Resource = _t, Capacity = _t]),
    Source = List.Dates(#date(2025,4,16), 5, #duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each resourceTable),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Resource", "Capacity"}, {"Resource", "Capacity"}),
    #"Sorted Rows" = Table.Sort(#"Expanded Custom",{{"Resource", Order.Ascending}, {"Date", Order.Ascending}})
in
    #"Sorted Rows"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Much easier than I thought it would be! THANKS

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon โ€“ Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save โ‚ฌ200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.