Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi Experts...
I cannot work out how to reslove the following error message.
My capture_day_id is in the format 2020101 and not 01/01/20
My expiration_day_id is in the format 2020101 and not 01/01/20
I am trying to work out the duration in days between the two dates.
List.Dates(
Date.FromText([capture_day_id]),
Duration.Days(
#date(Number.FromText(Text.Start([capture_day_id],4)), Number.FromText(Text.Middle([capture_day_id],4,2)),Number.FromText(Text.End([capture_day_id],2)))
,
#date(Number.FromText(Text.Start([expiration_day_id],4)), Number.FromText(Text.Middle([expiration_day_id],4,2)),Number.FromText(Text.End([expiration_day_id],2)))
),
#duration(1, 0, 0, 0))
Solved! Go to Solution.
@Anonymous , try Date.FromText([capture_day_id])
refer https://docs.microsoft.com/en-us/powerquery-m/date-fromtext
@Anonymous , try Date.FromText([capture_day_id])
refer https://docs.microsoft.com/en-us/powerquery-m/date-fromtext
Same error message
@Anonymous , Yes, I also checked out. if only MM can be 1,2, 3 etc then we can do like
if then Text.Length(Text.Length) = 7 then #date(Number.FromText(Text.Start([capture_day_id],4)), Number.FromText(Text.Middle([capture_day_id],4,1)),Number.FromText(Text.End([capture_day_id],2)))
else #date(Number.FromText(Text.Start([capture_day_id],4)), Number.FromText(Text.Middle([capture_day_id],4,2)),Number.FromText(Text.End([capture_day_id],2)))
Slightly confused - can you add the full formula PLEASE. Thanks
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 60 | |
| 45 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 108 | |
| 108 | |
| 41 | |
| 30 | |
| 27 |