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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
maclura
Resolver I
Resolver I

Create missing records for missing dates

Hi,

I know there are many questions like this, but I don't have enough DAX to customize them to solve my problem.

 

In short,

I have this daily summary table

maclura_0-1643108473141.png

and I need to transform it like this

maclura_1-1643108530353.png

 

Until now I am just able to create a table which is the cartesian product of [ID] and my calendar [Date] with CROSSJOIN.
But I don't know how to associate the existing Val 1,2 and 3 to the proper record and populate the missing values with zeroes.

Thanks for any help.

maclura

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Once you have the cross join, one option to populate the columns is with a LOOKUPVALUE.

 

For example:

Val1 =
LOOKUPVALUE (
    Summary[Val1],
    Summary[ID], Transform[ID],
    Summary[Date], Transform[Date],
    0
)

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

Once you have the cross join, one option to populate the columns is with a LOOKUPVALUE.

 

For example:

Val1 =
LOOKUPVALUE (
    Summary[Val1],
    Summary[ID], Transform[ID],
    Summary[Date], Transform[Date],
    0
)

Dear @AlexisOlson ,

LOOKUPVALUE just works great! It's the solution to my problem.

It also allows me to avoid to SUMMARIZE duplicate entries in the source table. This is great!

Thank you.

maclura

amitchandak
Super User
Super User

@maclura , Do a left join in power query( Date table should be first or on left) , create a date table in power query

 

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

 

https://www.mssqltips.com/sqlservertip/6756/power-bi-calendar-table/

 

DAX Joines. or related columns

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you @amitchandak 
Even if this is not the solution to my problem, thanks to your suggested links, I refreshed a bit my knowledge on join types. Very interesting the article on DAX join with related or not related tables!

For my situation the CROSSJOIN (cartesian product of 2 tables) is the only solution to avoid losing "date" records.

Thank you for your input, you deserve a Kudo!

maclura

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.