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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.