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
Ackbar-Learner
Resolver I
Resolver I

Replicating all days in month based on 1st day of month

Hi

 

I am looking at attached thread (Solved: Duplicating data for the first day of the month to... - Microsoft Power BI Community). I have the same issue but with a little bit more complication. If you look at the sample data in that thread, there is only 1 line of data per month.

 

How do i do the same thing in the above thread if there were more lines of data per month? I tried to do it but Power Query creates all the dates only once and i need all the dates to be replicated for each line of data. To be more specific, i need below first screenshot to become like the second one. I already have a calendar table.

 

AckbarLearner_0-1677556440523.png

 

AckbarLearner_1-1677556469876.png

 

1 ACCEPTED SOLUTION
Ackbar-Learner
Resolver I
Resolver I

I was able to do this in Power query by reviewing all the steps and proceeding in a different way.

View solution in original post

4 REPLIES 4
Ackbar-Learner
Resolver I
Resolver I

I was able to do this in Power query by reviewing all the steps and proceeding in a different way.

Ackbar-Learner
Resolver I
Resolver I

What you sent me is perfectly alright when using DAX but i need to do this in Power Query as I have several dependent steps that will come after the above is done.

 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a calculated table.

 

Jihwan_Kim_0-1677562467145.png

 

 

New Table = 
SUMMARIZE (
    ADDCOLUMNS (
        GENERATE (
            Data,
            FILTER (
                'Calendar',
                'Calendar'[Date] > EOMONTH ( Data[Date], -1 )
                    && 'Calendar'[Date] <= EOMONTH ( Data[Date], 0 )
            )
        ),
        "@No of SKU", CALCULATE ( SUM ( Data[No of SkU] ) ) + 0
    ),
    Data[Country],
    Data[Product],
    'Calendar'[Date],
    [@No of SKU]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Oops i need to do this in Power Query, not using DAX.

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