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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors