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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Rabi
Resolver I
Resolver I

Translating pay ending date into individual or daily date

Hi Everyone

 

I have a table like this which i want to translate as table below. I do have a table that has individual date and pay ending date

Initial Table
Locationpay ending datevalue
Location15/01/2025200

 

Achieve below

Achieve this in a new table  
LocationDatevalue
Location2/01/202514.28571
Location3/01/202514.28571
Location4/01/202514.28571
Location5/01/202514.28571
Location6/01/202514.28571
Location7/01/202514.28571
Location8/01/202514.28571
Location9/01/202514.28571
Location10/01/202514.28571
Location11/01/202514.28571
Location12/01/202514.28571
Location13/01/202514.28571
Location14/01/202514.28571
Location15/01/202514.28571
  200 (True)

 

 

Thanks !!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below, and hard-coded the start date = January 02nd 

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1747105073923.png

 

expected result table = 
	VAR _calendar = ADDCOLUMNS(
		CALENDAR(
			DATE(YEAR(MIN(data[pay ending date])), 1, 1),
			DATE(YEAR(MAX(data[pay ending date])), 12, 31)
		),
		"Year", YEAR([Date]),
		"Month number", MONTH([Date]),
		"Day of month", DAY([Date])
	)
	VAR _t = GENERATE(
		data,
		FILTER(
			_calendar,
			[Year] = YEAR(data[pay ending date]) && [Month number] >= 1 && [Month number] <= MONTH(data[pay ending date]) && [Day of month] >= 2 && [Day of month] <= DAY(data[pay ending date])
		)
	)
	VAR _average = ADDCOLUMNS(
		ADDCOLUMNS(
			_t,
			"@rowcount", COUNTROWS(FILTER(
				_t,
				data[Location] = EARLIER(data[Location])
			))
		),
		"@value", FORMAT(
			DIVIDE(
				data[value],
				[@rowcount]
			),
			"#,#0.00000"
		)
	)
	RETURN
		SUMMARIZE(
			_average,
			data[Location],
			[Date],
			[@value]
		)

 


 

    Microsoft MVP
 

 

   


      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.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


View solution in original post

2 REPLIES 2
v-sgandrathi
Community Support
Community Support

Hi @Rabi,

 

Has your issue been resolved?If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.

 

Thank you for your understanding!

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below, and hard-coded the start date = January 02nd 

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1747105073923.png

 

expected result table = 
	VAR _calendar = ADDCOLUMNS(
		CALENDAR(
			DATE(YEAR(MIN(data[pay ending date])), 1, 1),
			DATE(YEAR(MAX(data[pay ending date])), 12, 31)
		),
		"Year", YEAR([Date]),
		"Month number", MONTH([Date]),
		"Day of month", DAY([Date])
	)
	VAR _t = GENERATE(
		data,
		FILTER(
			_calendar,
			[Year] = YEAR(data[pay ending date]) && [Month number] >= 1 && [Month number] <= MONTH(data[pay ending date]) && [Day of month] >= 2 && [Day of month] <= DAY(data[pay ending date])
		)
	)
	VAR _average = ADDCOLUMNS(
		ADDCOLUMNS(
			_t,
			"@rowcount", COUNTROWS(FILTER(
				_t,
				data[Location] = EARLIER(data[Location])
			))
		),
		"@value", FORMAT(
			DIVIDE(
				data[value],
				[@rowcount]
			),
			"#,#0.00000"
		)
	)
	RETURN
		SUMMARIZE(
			_average,
			data[Location],
			[Date],
			[@value]
		)

 


 

    Microsoft MVP
 

 

   


      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.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.