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
Anonymous
Not applicable

Add missing date first day per month

Hi,
I have a table like this:-

Rick_ferreira_0-1623874009626.png

But I need to add missing data between month, but only first day from each month which value is the same the last month. Like this:

Rick_ferreira_1-1623874084892.png


Is there some way to add the missing data?

Thanks

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

You need to add a new table , please use the following formula to have a try:

New Table =
ADDCOLUMNS (
    DISTINCT (
        SELECTCOLUMNS (
            CALENDAR ( MIN ( 'Table'[Date] ), TODAY () ),
            "Date", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 )
        )
    ),
    "Value",
        VAR _filldate =
            MAXX ( FILTER ( 'Table', 'Table'[Date] <= EARLIER ( [Date] ) ), [Date] )
        RETURN
            LOOKUPVALUE ( 'Table'[Value], 'Table'[Date], _filldate )
)

The final output is shown below:

Add missing date.PNG

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

You need to add a new table , please use the following formula to have a try:

New Table =
ADDCOLUMNS (
    DISTINCT (
        SELECTCOLUMNS (
            CALENDAR ( MIN ( 'Table'[Date] ), TODAY () ),
            "Date", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 )
        )
    ),
    "Value",
        VAR _filldate =
            MAXX ( FILTER ( 'Table', 'Table'[Date] <= EARLIER ( [Date] ) ), [Date] )
        RETURN
            LOOKUPVALUE ( 'Table'[Value], 'Table'[Date], _filldate )
)

The final output is shown below:

Add missing date.PNG

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors