Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I am attempt to solve an issue where I believe I am starting with some misconceptions, so I would like to explain a very simple scenario, the solution and why the solution works.
Image a Dimension table having Hours 1 to 12 (in practice, a Date table, but I am using hours here to demonstrate).
| Hour |
| 1 |
| ... |
| 12 |
Imagine a Fact table having series data Each Value entry is either true, false, or we don't have a data point for the specific hour as in the below table.
| Hour | Value |
| 2 | True |
| 3 | True |
| 4 | False |
| 6 | True |
| 7 | True |
| 8 | False |
| 11 | True |
How do I use DAX (or Power Query if more appropriate) to essentially create a SQL left join so that every Hour is represented in the second table, and that blank Values are filled with the value that is the first previous (in hour order) non empty value? In the below table, new values represented in italics.
| Hour | Value |
| 1 | False |
| 2 | True |
| 3 | True |
| 4 | False |
| 5 | False |
| 6 | True |
| 7 | True |
| 8 | False |
| 9 | False |
| 10 | False |
| 11 | True |
| 12 | True |
This a very simple representation of what I am trying to understand after struggling with LASTNONBLANK and similar functions. The actual Value column is an aggregate of integer entries that that occur in that hour, in which I'd like to use the first previous aggregated value.
Jason
Solved! Go to Solution.
Hi @JasonBurdetts,
Yes, this can be achieved either with DAX or Power Query, but based on your explanation, Power Query may be the simpler option. Since your actual Value column is an aggregate of integer entries that occur within each hour, the key is to aggregate first, then fill down.
The correct order would be:
💡 Helpful? Give a Kudos 👍 — keep the community growing
✅ Solved your issue? Mark as Solution ✔️ — help others find it faster
Best regards,
Rupasree Achari | BI & Fabric Analytics Engineer
Do this in Power Query, much cleaner than DAX here.
Start from your Hour list (1-12) and left join the Fact table on Hour. Missing hours show null.
Sort by Hour ascending.
Right-click the Value column, Fill > Down. That carries the last value forward into the blanks.
Replace any leftover null at Hour 1 with False.
If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande
Hi @JasonBurdetts,
Yes, this can be achieved either with DAX or Power Query, but based on your explanation, Power Query may be the simpler option. Since your actual Value column is an aggregate of integer entries that occur within each hour, the key is to aggregate first, then fill down.
The correct order would be:
💡 Helpful? Give a Kudos 👍 — keep the community growing
✅ Solved your issue? Mark as Solution ✔️ — help others find it faster
Best regards,
Rupasree Achari | BI & Fabric Analytics Engineer
@JasonBurdetts If your require to use DAX then pull the hour from the Dim table to the visual and add below DAX Measure to it to get the desired result.
Filled Value =
VAR CurrentHour =
MAX ( DimHour[Hour] )
VAR PreviousFactHour =
CALCULATE (
MAX ( Fact[Hour] ),
FILTER (
ALL ( 'Fact' ),
'Fact'[Hour] <= CurrentHour
&& NOT ISBLANK ( Fact[Value] )
)
)
RETURN
IF (
ISBLANK ( PreviousFactHour ),
BLANK (),
CALCULATE (
SELECTEDVALUE ( 'Fact'[Value] ),
FILTER (
ALL ( 'Fact' ),
'Fact'[Hour] = PreviousFactHour
)
)
)🎯Result -
💡 Helpful? Give a Kudos 👍 — keep the community growing
✅ Solved your issue? Mark as Solution ✔️ — help others find it faster
Best regards,
Rupasree Achari | BI & Fabric Analytics Engineer
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |