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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Help with model fix

Hello,

I have an issue with my model, it was working perfectly but all of a sudden I am getting the below error. It relates to one of the formula below howver I can not find anything wrong with the formula. Additionally, if I refresh each of the tables individually on transform data it works however if I hit refresh on the visuals then it gives the below error. Please help I am not entirely sure what wrong or how to fix. I have also sent frown which directed m

HT - Days Worked =
VAR targetstartdate= SELECTEDVALUE('Global Staff Targets'[Target Start Date])
VAR endomonth = ENDOFMONTH(Dates[Date])
VAR startmonth = STARTOFMONTH(Dates[Date])
VAR enddate =
IF(TODAY()>=endomonth,endomonth,TODAY()
)
VAR startdate =
IF(
targetstartdate<=startmonth,startmonth,targetstartdate
)
RETURN IF(DATEDIFF(startdate, enddate,DAY) <0,0, (DATEDIFF(startdate, enddate,DAY)))+1

Kryssy_0-1652032774278.png

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

The error detail has shown that 'A column specified in the call to function 'ENDOFMONTH' is not Type of DATE'.

veasonfmsft_0-1652247261838.png

Please check if your Table ‘Dates’  is continuous and the data type of date[date] is  of type DATE.

You can refer to these related threads.

Reason for error: 'A column specified in the call to function 'PARALLELPERIOD' is not of type DATE' 

A column specified in the call to function is not of type date 

MdxScript(Model) (8, 67) Calculation error in measure A column specified in the call to function 

 

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

The error detail has shown that 'A column specified in the call to function 'ENDOFMONTH' is not Type of DATE'.

veasonfmsft_0-1652247261838.png

Please check if your Table ‘Dates’  is continuous and the data type of date[date] is  of type DATE.

You can refer to these related threads.

Reason for error: 'A column specified in the call to function 'PARALLELPERIOD' is not of type DATE' 

A column specified in the call to function is not of type date 

MdxScript(Model) (8, 67) Calculation error in measure A column specified in the call to function 

 

Best Regards,
Community Support Team _ Eason

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.