March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have a date table which defines the phases of a project every year as follows:
Phase 1 = 1st January - 31st July
Phase 2 = 1st August - 31st December
I have created a column in my date table to work out and display the Current Phase so this can be used in a slicer using:
Solved! Go to Solution.
HI @msommerf
Ok, try this way:
previous phase =
var _current= CALCULATE(MAX(Dates[Phase Year]),FILTER(Dates,Dates[Phase Selection]="Current Phase")) return
IF(IF(RIGHT(_current,1)="2",LEFT(_current,4)&" Phase 1",VALUE(LEFT(_current,4))-1&" Phase 2")=Dates[Phase Year],"Previous Phase",Dates[Phase Year])
Regards,
Lin
hi @msommerf
Just create a column as below:
previous phase = IF(RIGHT(Dates[Phase Year],1)="2",LEFT(Dates[Phase Year],4)&" Phase 1",VALUE(LEFT(Dates[Phase Year],4))-1&" Phase 2")
Regards,
Lin
Many thanks for your response.
Your solution works in that it is displaying the previous Phase Year.
I was looking for the column to display the words "Previous Phase" in this column and not display the phase year value.
HI @msommerf
Ok, try this way:
previous phase =
var _current= CALCULATE(MAX(Dates[Phase Year]),FILTER(Dates,Dates[Phase Selection]="Current Phase")) return
IF(IF(RIGHT(_current,1)="2",LEFT(_current,4)&" Phase 1",VALUE(LEFT(_current,4))-1&" Phase 2")=Dates[Phase Year],"Previous Phase",Dates[Phase Year])
Regards,
Lin
Hi @msommerf ,
Create a caluclated column as follows:
Thank you for your quick response.
I have created a calculated column using your DAX formula as follows:
Regards
Mark.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
86 | |
70 | |
51 |
User | Count |
---|---|
206 | |
150 | |
97 | |
78 | |
69 |