Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
62 | |
60 |
User | Count |
---|---|
197 | |
118 | |
108 | |
78 | |
69 |