Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JasonUser000
Frequent Visitor

Cannot convert value '' of type Text to type Number.

Hello, I have create a calendar date to coincide with fiscal year. It was recently working and just broke with a new upload of monthly data. Wondering how to fix this? 

JasonUser000_0-1675966297895.png

 

9 REPLIES 9
grantsamborn
Solution Sage
Solution Sage

Hi @JasonUser000 

It appears you are using the result of RIGHT() (text type) as a number in the calculation.

Try replacing:

     RIGHT( Query[Fiscal Year], 2)

with:

     VALUE( RIGHT( Query[Fiscal Year], 2) )

 

 

Hello,

 

Unfortunately that did not work. It is still showing as error.

Is it still the same error?

Did you do the replacement in both places?

Is Query[Month_Number] numeric?

Yes, I added to both places and Query[Month_Number] is numeric (1.2).

 

This seems like it could be handled with a date table with [Fiscal Year] and [Fiscal Period] calculated for each [Date] ahead of time.

DimDate.m

Date Dimension Setup using M script.docx

 

Not sure what it would be.

Here is an example with [Month_Number] as a whole number and [Fiscal Year] as text, using your calculated column.

Calendar Date problem.pbix

 

I copied your exact DAX -  however it still is showing error although it works on your end.

 

My guess is you have an invalid value for [Fiscal Year] .

I would start by looking for a blank row.

 

My fiscal year Column is "F22, F23,..." Not 2022, 2023 which I cannot convert to number. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors