cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Combining year and week to a unique ID

Hi guys, and thank you for all the great help this community offers. 

 

I've ran into a little issue. I need to comine two collumns containing year and week into one uniqe number. A global week number if you like. E.g the first week will need to have the uniqe ID of 1, next week 2 and so on. As i'm using the number at a later stage it needs to remain a value. 

 

Any suggestions for solutions? 

 

 

Cheers! globalweek.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Combining year and week to a unique ID

I actually created this once and put it in the Quick Measure gallery as "Sequential"

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User IV
Super User IV

Re: Combining year and week to a unique ID

I actually created this once and put it in the Quick Measure gallery as "Sequential"

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Re: Combining year and week to a unique ID

Maybe just (year * 100) + week, so you get values like:

 

201701 (week 1 of 2017)

201702 (week 2 of 2017)

etc

 

?

 

Thx,

Scott

Anonymous
Not applicable

Re: Combining year and week to a unique ID

Thank you! Great that you also include the Power Bi file so it can easily be studied! 

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors