Forum Discussion
Anonymous
5 years agoNot applicable
Dax to M
Hi, can you help me traslate this to M ? Need a custom column:
Train_no_unique = SWITCH(TRUE(),
MONTH(BPS[date])<=11,YEAR(BPS[date])&"_"&BPS[TRAIN_NUMBER],
YEAR(BPS[date])+1&"_"&BPS[TRAIN_NUMBER])
I think it would like:
= if Date.Month([date]) <= 11 then Text.From(Date.Year([date])) & "_" & [TRAIN_NUMBER] else Text.From(Date.Year([date] + 1)) & "_" & [TRAIN_NUMBER]please note that M is case sensitive, so if your column is Date use Date not date.
1 Reply
- artemusMicrosoft Employee
I think it would like:
= if Date.Month([date]) <= 11 then Text.From(Date.Year([date])) & "_" & [TRAIN_NUMBER] else Text.From(Date.Year([date] + 1)) & "_" & [TRAIN_NUMBER]please note that M is case sensitive, so if your column is Date use Date not date.