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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
aDrieZ
New Member

Use a date value to transform an integer - cannot convert value 'September' of type Text to type Int

Hi all, i am new to PowerBI.
I receive a date value from our database as well as an integer (number of days to deadline).
The problem is, that this value is always positiv, also when the deadline is missed.
So i want to use the date value to transform the daysToDeadline value into a negativ value when the date is lower than today.
I have tried the way excel does this, but this won't work.

Here is my code::

 

anpVerzug = IF(AND(DATE(qryAuftraegeAnDisplays[Starttermin_Plan].[Jahr],qryAuftraegeAnDisplays[Starttermin_Plan].[Monat],qryAuftraegeAnDisplays[Starttermin_Plan].[Tag]) < TODAY(), NOT ISBLANK(qryAuftraegeAnDisplays[Starttermin_Plan])), qryAuftraegeAnDisplays[Verzug] * -1, qryAuftraegeAnDisplays[Verzug])

 

Starttermin_Plan is the date
Verzug is the number of days to deadline.

How can i solve this?

1 REPLY 1
HotChilli
Super User
Super User

I think you can simplify the date comparison and it will reduce to this:

anpVerzug = IF(AND(qryAuftraegeAnDisplays[Starttermin_Plan] < TODAY(), NOT ISBLANK(qryAuftraegeAnDisplays[Starttermin_Plan])), qryAuftraegeAnDisplays[Verzug] * -1, qryAuftraegeAnDisplays[Verzug])

I haven't tested it, try it out

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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