Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 40 | |
| 36 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 73 | |
| 73 | |
| 38 | |
| 35 | |
| 26 |