Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |