cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rick_ferreira
Helper III
Helper III

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
Eyelyn9
Community Support
Community Support

Hi @Rick_ferreira ,

 

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 III
Super User III

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/
Eyelyn9
Community Support
Community Support

Hi @Rick_ferreira ,

 

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

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors