Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I would like to turn number of days into weeks, my days column is a numeric field. I solved this by dividing the number of days by 7 but wanted to know if there was a function in power query for this task. As functions tend to normally have other data preserving measures such as ignoring nulls
Solved! Go to Solution.
Hi @akhaliq7,
The approach you've taken is correct, there is no standard library function in the M language (at this time) to determine the number of weeks based on a number of elapsed days.
For dealing with null values you can include the coalese operator: ?? (a double questionmark) directly following the field reference that could include nulls and supply it an alternative, to illlustrate:
[Num of Days] / 7 //if [Num of Days] = null this will return null
[Num of Days]?? 0 / 7 //if [Num of Days] = null then 0 this will return 0
Ps. If this helps solve your query please mark this post as Solution, thanks!
Hi @akhaliq7,
The approach you've taken is correct, there is no standard library function in the M language (at this time) to determine the number of weeks based on a number of elapsed days.
For dealing with null values you can include the coalese operator: ?? (a double questionmark) directly following the field reference that could include nulls and supply it an alternative, to illlustrate:
[Num of Days] / 7 //if [Num of Days] = null this will return null
[Num of Days]?? 0 / 7 //if [Num of Days] = null then 0 this will return 0
Ps. If this helps solve your query please mark this post as Solution, thanks!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 19 | |
| 14 | |
| 11 | |
| 9 | |
| 8 |