Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi
If someone can assist please?
I would like to say in 1 column the below please?
The rdate contains a series of dates in the past and the future.
rdate = last order over 2 and a half years ago then 1
rdate= should be re-ordered within 6 months then 2
rdate= order last reviewed less than 2 and a half years ago then 3
Solved! Go to Solution.
Ok. I wrote the formula for a measure actually.
Please use the following for calculated column:
rdateCalc =
VAR __Difference =
DATEDIFF ( 'SomeDateTable'[rdate], TODAY (), DAY )
VAR __Result =
IF (
__Difference > 913,
1,
IF (
__Difference < 913
&& __Difference > 0,
3,
IF ( __Difference < 0 && __Difference > -180, 2, BLANK () )
)
)
RETURN
__Result
In a calculated column?
Ok. I wrote the formula for a measure actually.
Please use the following for calculated column:
rdateCalc =
VAR __Difference =
DATEDIFF ( 'SomeDateTable'[rdate], TODAY (), DAY )
VAR __Result =
IF (
__Difference > 913,
1,
IF (
__Difference < 913
&& __Difference > 0,
3,
IF ( __Difference < 0 && __Difference > -180, 2, BLANK () )
)
)
RETURN
__Result
Ahh that is fantastic-thank you! I need to learn now what everything is doing 🙂
Hi @matts29 ,
Can you try this?
rdateCalc =
VAR __Difference =
DATEDIFF ( MAXX ( 'SomeDateTable', 'SomeDateTable'[rdate] ), TODAY (), DAY )
VAR __Result =
IF (
__Difference > 913,
1,
IF (
__Difference < 913
&& __Difference > 0,
3,
IF ( __Difference < 0 && __Difference > -180, 2, BLANK () )
)
)
RETURN
__Result
Thanks but I just have all blanks in the column unfortunatley...
sure this is the adjusted formula
VAR __Difference =
DATEDIFF ( MAXX ( 'SomeDateTable', 'SomeDateTable'[rdate] ), TODAY (), DAY )
VAR __Result =
IF (
__Difference > 913,
1,
IF (
__Difference < 913
&& __Difference > 0,
3,
IF ( __Difference < 0 && __Difference > -180, 2, BLANK () )
)
)
RETURN
__Result
This s the sample data from the date table
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |