cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Till
Resolver II
Resolver II

Create a Version Number

Hi All,
I would like to create the Version column using a Measure or Calculated column. The newest version should always be number 1. It can happen that several versions are loaded during the day. With Max I would always get the latest version but I need an automatic numbering.
Thanks for suggestions

Unbenannt.PNG

 

2 ACCEPTED SOLUTIONS
v-jayw-msft
Community Support
Community Support

Hi @Till ,

 

Accoring to your screenshot, are you want to add independent index for each location?

If so, you could try using RANKX() function.

https://docs.microsoft.com/en-us/dax/rankx-function-dax 

However, Sorting text data with RANKX() function may not be so accurate. So you will need to convert the text column to DATETIME type.

_datetime = DATE(MID('Table'[s_insert_ts],7,4),MID('Table'[s_insert_ts],4,2),MID('Table'[s_insert_ts],1,2))+TIMEVALUE(RIGHT('Table'[s_insert_ts],5))

Then create a rank column as below.

Column = RANKX(FILTER('Table','Table'[location]=EARLIER('Table'[location])),'Table'[_datetime],,DESC)

4.PNG

 

Best Regards,

Jay

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

View solution in original post

HI 

PREVIEW
thank you, you have helped me a lot.

It works

@AllisonKennedy 
Thank you also for your help

Have a nice week.

Till

View solution in original post

6 REPLIES 6
v-jayw-msft
Community Support
Community Support

Hi @Till ,

 

Accoring to your screenshot, are you want to add independent index for each location?

If so, you could try using RANKX() function.

https://docs.microsoft.com/en-us/dax/rankx-function-dax 

However, Sorting text data with RANKX() function may not be so accurate. So you will need to convert the text column to DATETIME type.

_datetime = DATE(MID('Table'[s_insert_ts],7,4),MID('Table'[s_insert_ts],4,2),MID('Table'[s_insert_ts],1,2))+TIMEVALUE(RIGHT('Table'[s_insert_ts],5))

Then create a rank column as below.

Column = RANKX(FILTER('Table','Table'[location]=EARLIER('Table'[location])),'Table'[_datetime],,DESC)

4.PNG

 

Best Regards,

Jay

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

HI 

PREVIEW
thank you, you have helped me a lot.

It works

@AllisonKennedy 
Thank you also for your help

Have a nice week.

Till

AllisonKennedy
Super User
Super User

@Till  Can you use Power Query? If so, sort the s_insert_ts column first Descending, then click Add Column > Index > From 1


Please @mention me in your reply if you want a response.

Check out my Olympics report with live stats - KUDOS much appreciated

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi Allison,
thank you for your message.
Yes, that would work.
However, today I have the challenge that one more site is added. Then this does not work. Do you also have a solution for this?

 

Unbenannt.PNG

 

 



@Till 

Sorry, I don't understand your question - is the screenshot what actually happened or what you want to happen? Is the raw data coming from different files?


Please @mention me in your reply if you want a response.

Check out my Olympics report with live stats - KUDOS much appreciated

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi Allison,

It is one table where the Location column has been added. These locations can make uploads in the table, which means that they are attached to the back of the table.
KR and thank's for your help.
Till

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!