The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I hope to make a new column in Query using M code like below:
To give Quarter number attribute to all row values.
Please help.
Solved! Go to Solution.
maybe you can try this
1. add a new column
=if Text.Contains([comments],"Q1") or Text.Contains([comments],"Q2") or Text.Contains([comments],"Q3") or Text.Contains([comments],"Q4") then [comments] else null
then select the new column and fill down
Proud to be a Super User!
you can change to
=if [comments]="Q1"or [comments]="Q2" or [comments]="Q3" or [comments]="Q4" then [comments] else null
Proud to be a Super User!
maybe you can try this
1. add a new column
=if Text.Contains([comments],"Q1") or Text.Contains([comments],"Q2") or Text.Contains([comments],"Q3") or Text.Contains([comments],"Q4") then [comments] else null
then select the new column and fill down
Proud to be a Super User!
Hi,
As to Text.Contains, can we change M code to exact Q1~Q4 value not contains?
you can change to
=if [comments]="Q1"or [comments]="Q2" or [comments]="Q3" or [comments]="Q4" then [comments] else null
Proud to be a Super User!
Thanks!
you are welcome
Proud to be a Super User!
Thanks! accpeted.
you are welcome
Proud to be a Super User!