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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

MY23 and MY22 DAX query

Hello, 

 

We are getting ready to import MY23 data but we are having an issue with allowing both MY23 DATA to be shown and MY22 data on the same report. The query that was previously written doesn't work with implement MY23 data 

 
MYTD = IF(or(and('Market Year Dates'[Current MY Period]='Market Year Dates'[MY Period],'Market Year Dates'[Day]<'Market Year Dates'[Current Day]),'Market Year Dates'[MY Period]<'Market Year Dates'[Current MY Period]),"Y","N")

 

Currently I have hardcoded MY as 2022 in order to only pull MY22 data because when we use the QUERY above it does not allow me to filter to MY22 data. 

 

Please let me know if it's possible how to allow end users to filter to MY22  and the new MY23 data.  

 

Thanks in advance

4 REPLIES 4
aj1973
Community Champion
Community Champion

Hi @Anonymous 

To compare Data from Year to Year, it is recommended to add a DATE_TABLE, join it to your Master table and then use Time Intelligence functions. 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Anonymous
Not applicable

Hey we have already an existing time table but when importing multiple years of data the DAX query is not able to get both years.

 

Current Market Year = IF('Market Year Dates'[Current Month]>=10,'Market Year Dates'[Current Year]+1,'Market Year Dates'[Current Year])
 
This DAX query is not working with the previous year data and NEW data coming in. 
aj1973
Community Champion
Community Champion

Not sure what you want to achieve but you need to use TI functions to get to compare data, like SAMEPERIODLASTYEAR() or DATE ADD()...

Maybe if you share your PBIX I can be more helpful.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Anonymous
Not applicable

hello 

 

Here is the problem MY23 data is showing up with the below DAX Query but MY22 data is not showing up.

Current Market Year = IF('Market Year Dates'[Current Month]>=10,'Market Year Dates'[Current Year]+1,'Market Year Dates'[Current Year]
 

MY23MY23MY22MY22

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors