cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Date wrong type

When I was tryin to create YTD last year formula ,its getting anerror when it pulled to visual.

 Error.png

 DAX:

 

Spent_Amnt_YTD_LY = VAR DataMaxDate =
CALCULATE (DATE(YEAR(max(DETAIL[CHECK_DATE]))-1,MONTH(MAX(DETAIL[CHECK_DATE])),DAY(MAX(DETAIL[CHECK_DATE]))))
RETURN
CALCULATE (
[INV AMT$], ALLSELECTED('DATE'),
DATESYTD(
INTERSECT (
VALUES ( 'DATE'[Date] ),
DATESBETWEEN ( 'DATE'[Date], BLANK (), DataMaxDate )
)
)
)

1 ACCEPTED SOLUTION
Community Support
Community Support

Hi @ja832153 ,

 

Wrong data type of the parameter in datesbetween() function.

Refer:

https://docs.microsoft.com/en-us/dax/datesbetween-function-dax.

If you can share some sample data and expected result, we might help you deal with the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @ja832153 ,

 

Wrong data type of the parameter in datesbetween() function.

Refer:

https://docs.microsoft.com/en-us/dax/datesbetween-function-dax.

If you can share some sample data and expected result, we might help you deal with the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Super User IV
Super User IV

@ja832153 , why are you giving blank in DATESBETWEEN 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors