Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a column ("calendar week) with numbers from 1-53 (the column is formatted as Integer). Now I want to put a 0 in front of the numbers 1-9 (=> 01,02,03, etc).
Can someone help me and tell me how to do it?
Thanks!
Anika
Solved! Go to Solution.
Please try this approach in a DAX column, using your table/column names.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Anika,
What i do is:
1. select column Calander week
2. transform column and add prefix "0"
3. transfrom same column and extract last 2 digits
If you want to keep your original column then use add column.
greatings
Please try this approach in a DAX column, using your table/column names.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
add a if statement, new column if(table[weeknumber]>9, table[weeknumber],"0"&CONVERT('Table'[caledar week],STRING))
note: this its for the weeknumber format, you make this a separate column and them concatenate with the first part you have before the weeknumber the "1-"weeknumber
also if you doing it in power query M code for the if satetemente instead of , for each part of the statem you use something like this ... if "conditions" them "statement if true" else "statement if false"
Proud to be a Super User!
try this:
Proud to be a Super User!
Many thanks for your response.
When I write this expression, it also add a 0 in front of the numbers 10-53 (010, 011,053 etc.)
I only want to add a 0 in front of the numbers 1-9, so that all numbers in the column are two-digit
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.