This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hai All I need your Full support On this
Scenario : I Have Sales table and users will send every new version on month basis.
I have a forecast version column like this |
And every month i am appending new version with previous one
Requirment is i want to create one Custom column for previous version as dynamically
For eg : Now let's Assume latest version is V6-June-2021 and i want to create a dynamic custom column in power query or deskptop
Out put should be like this
Latest Version V7-June-2021
Previous Version V6-June-2021
Latest Version V6-june-2021
previous Version V5-May-2021
Solved! Go to Solution.
@Anonymous
Sorry for the late reply. I got involved with some other business. Here is the sample file with the solution https://www.dropbox.com/t/dDXhM0NNwthWhfEy
Actually I allways prefer DAX. I find it much more simple than PQ. However, as along as you need this to be part of your source data please use the following M code
= Table.AddColumn(#"Promoted Headers", "Previous Version",
each if Int64.From(Text.BetweenDelimiters([Forcast Version], "V", "-")) -1 = 0
then "V12-December-" & Number.ToText( Int64.From(Text.AfterDelimiter([Forcast Version], "-", 1)) - 1 )
else "V" & Number.ToText( Int64.From(Text.BetweenDelimiters([Forcast Version], "V", "-")) - 1 )
& "-" & Date.MonthName (#datetime ( 2020, Int64.From(Text.BetweenDelimiters([Forcast Version], "V", "-")) - 1, 01,0,0,0 ))
& "-" & Number.ToText( Int64.From(Text.AfterDelimiter([Forcast Version], "-", 1)) - 1))Hi @Anonymous
Do you mean "July"?
Sorry , it's My mistake
V7-July-2021
@Anonymous
Sorry for the late reply. I got involved with some other business. Here is the sample file with the solution https://www.dropbox.com/t/dDXhM0NNwthWhfEy
Actually I allways prefer DAX. I find it much more simple than PQ. However, as along as you need this to be part of your source data please use the following M code
= Table.AddColumn(#"Promoted Headers", "Previous Version",
each if Int64.From(Text.BetweenDelimiters([Forcast Version], "V", "-")) -1 = 0
then "V12-December-" & Number.ToText( Int64.From(Text.AfterDelimiter([Forcast Version], "-", 1)) - 1 )
else "V" & Number.ToText( Int64.From(Text.BetweenDelimiters([Forcast Version], "V", "-")) - 1 )
& "-" & Date.MonthName (#datetime ( 2020, Int64.From(Text.BetweenDelimiters([Forcast Version], "V", "-")) - 1, 01,0,0,0 ))
& "-" & Number.ToText( Int64.From(Text.AfterDelimiter([Forcast Version], "-", 1)) - 1))Hai @tamerj1 Can you try to create same solution in dax format, this solution is working
@Anonymous ,
Create a new column in DAX (on in power query)
Date = datevalue(right([version], len([version]-1) )
Now create a rank
Rank = rankx(Table, [Date],,desc, dense)
now
flag for latest
if([Rank] =1 1, "Latest", [Rank])
these column can be used Rank can also used to find by adding +1
refer examples, I have used -1 as I have desc rank (Custom Period)
DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 38 | |
| 29 | |
| 28 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 65 | |
| 35 | |
| 30 | |
| 25 | |
| 23 |