Forum Discussion
DAX give different outputs when I expect the same
Hi! I need som help here
Value from selected date =
The measures shoud give the exact same output if I enter May 2024 in the first and may 2025 in the last - but there is a sliight difference.
Value from selected date in prev year
Help me understand why there is a difference!
Hi!
I think its solved, but its not due to any of the reasons listed below. Thank you for your support.
10 Replies
- FBergamaschi
Super User
Hi,
EOMONTH expectes a date as first input. I do not know what data type is your datekey column.
I tried this for the second measure
VAR CurrentMaxDate = MAX('Calendar'[Date])VAR StartDate = EOMONTH(CurrentMaxDate, -12)RETURNCALCULATE(SUM(Sales[SalesAmount]),ALL('Calendar'),'Calendar'[Date] > Startdate
)and it works perfectly, but I used a date column of date format. So either you use a column like that or you convert the datekey into a date with the DATE DAX Function in combination with LEFT, MID, RIGHTIf this helped please mark this as a solution and give kudosThanksBest- KristinGFrequent Visitor
Hi,
Thanks for your reply!
Its not a data type issue, 'Calendar'[DateKey] is date format
- v-venuppu
Community Support
Hi KristinG ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you FBergamaschi for the prompt response.
I have created PBIX file using sample data, you can implement it using your data.Please go through the attached PBIX file for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly.
Thank you.
- KristinGFrequent Visitor
Hi,
Thanks for your reply!
Your file is unfortunately showing the exact same value no matter what YearMonth I filter on, so a its a bit hard to see if ot actually solves the problem..
- KristinGFrequent Visitor
Hi!
I think its solved, but its not due to any of the reasons listed below. Thank you for your support.
- v-venuppu
Community Support
Hi KristinG ,
Great to hear that it's solved from your end! Could you please share the solution? It would be really helpful for others in the community who might be facing similar issues and can address them quickly. Also, I would suggest accepting your approach as the solution so that it can benefit others as well.
Thank you.