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
Franklin1
Advocate I
Advocate I

Duplicating data for the first day of the month to the whole month

Hey smart people,

 

I have a super tough issue here, and i would kindly appreciate any kind of help.

I am trying to solve this issue with no success for too much time.

 

I have a set of queries with a lot of data, and they are all linked and work great.

The issue is that one of the tables, include data (with links to other tables - such as date, segment) but instead of having the data (#) for the whole month, it is only mention the number for the first day of the month. 

The number is OK, but should be the same for the whole month.

instead, I have the right number gor the 1st day of the month, and 0 for the rest of the month.

 

i addition, i take this number as the denominator for a few calculations that i am doing, and again, the result is OK for the 1st day of the month, but the rest of the month it is Infinity...

 

I really need your help here, and appreciate any idea!!!

I am running out of ideas at this stage, and this job has to be done urgently...

 

thanks a lot for any support!

1 ACCEPTED SOLUTION

Hi @Franklin1,

 

Assume the sample data start from 2016-6-1 like below:

 

z1.PNG

 

Then you can create a calendar table in Query Editor by click Get Data -> Blank Query, type = List.Dates(#date(2016, 6, 1), 500, #duration(1, 0, 0, 0)) in formula bar. Then convert list to a table.

 

z2.PNG

 

Use Merge Queries as New feature, Fill-> Down, then get below data.

 

z3.PNGz4.PNG

 

For details, you can download attached DuplicateData.pbix file to have a look.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

7 REPLIES 7
cs_skit
Resolver IV
Resolver IV

if thats possible for you to fix it on the data level you might be able to use this in PowerQuery (aka Query Editor)

 

Thanks a lot, but the table have no rows for the other days, but only for the 1st day of each month.

Do you think of any other solution?

Maybe a measure I can use, to mention that whether the date is differnet than the 1st of the day of the month, the return of the data should be the same as the data for the 1st of the day of the month.

Anyone knows the code for this measure?

 

Thanks. 

Is the data table where you only have one row per month for the first day really "date specific" data or is it more month specific data?

Because if its the latter you should join it to the month of your Calendar table instead of the specific date. Then for all dates of that month you could reference the data with RELATED() and don't have the issue of empty fields.

Thanks for your reply.

The table is date specific...

can you elaborate more about the RELATED() idea.

Maybe i can use it anyway?

Hi @Franklin1,

 

Assume the sample data start from 2016-6-1 like below:

 

z1.PNG

 

Then you can create a calendar table in Query Editor by click Get Data -> Blank Query, type = List.Dates(#date(2016, 6, 1), 500, #duration(1, 0, 0, 0)) in formula bar. Then convert list to a table.

 

z2.PNG

 

Use Merge Queries as New feature, Fill-> Down, then get below data.

 

z3.PNGz4.PNG

 

For details, you can download attached DuplicateData.pbix file to have a look.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I create custom time intelligence

http://databear.com/2016/11/08/power-bi-tip-dynamic-calendar-table/

then in my Calendar table I create all kinds of additional useful fields

There is also first day of the month in there which you could reference to your seperate table

but its usually better to reference year and Month like 201706. 

 

so you could extract the data to this form into a seperate table and then link it

MonthSomeValues
201704500
201705600
201706750

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.