cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kryssy
Helper I
Helper I

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, @Kryssy 

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, @Kryssy 

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
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors