Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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])
Solved! Go to Solution.
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.
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.