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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Alicia83B
Helper I
Helper I

Card visual shows MIN and MAX date YTD & PYTD

I currently am using a text box to capture the sales period. I would like to move away from manually updating this box every month.  

Text box currently looks like this:

           Sales Period
January – August 2022
January – August 2021

The below DAX measure results in the sales period 1/1/2022 – 8/31/2022

DAX: _AB CY Sales Period = MIN ('Calendar'[Date]) & " - " & MAX ( 'Calendar'[Date] )

DAX Results: 1/1/2022 – 8/31/2022

 

This is only producing half of what I need for the sales period. Can someone offer guidance on how I can achieve including the PY Sales Period with the CY Sales Period in the same card visual?

Below is the result I am looking to achieve. 

       Sales Period
1/1/2022 – 8/31/2022
1/1/2021 – 8/31/2021

 

If it helps, I currently am using CurYearOffset is 0 and CurMonOffset is less than or equal to -3 and is greater than or equal to -15 for filters on my page. I also have a table that include CY and PY Sales data. 

 

Thank you in advance for looking at my question.

1 ACCEPTED SOLUTION
Alicia83B
Helper I
Helper I

@v-mengzhu-msft  I have solved for this measure. 

 

Sales Period =
FIRSTDATE('Calendar'[Date]) & " - " & LASTDATE('Calendar'[Date]) & " " & FIRSTDATE('Calendar'[Date])-365 & " - " & LASTDATE('Calendar'[Date])-365
 
Below are my results when using Sales Period in a card visual. 
 
Alicia83B_0-1668191322455.png

 

View solution in original post

3 REPLIES 3
Alicia83B
Helper I
Helper I

@v-mengzhu-msft  I have solved for this measure. 

 

Sales Period =
FIRSTDATE('Calendar'[Date]) & " - " & LASTDATE('Calendar'[Date]) & " " & FIRSTDATE('Calendar'[Date])-365 & " - " & LASTDATE('Calendar'[Date])-365
 
Below are my results when using Sales Period in a card visual. 
 
Alicia83B_0-1668191322455.png

 

v-mengzhu-msft
Community Support
Community Support

Hi @Alicia83B ,

 

So your requirement is that you want to use card visual to display the maximum and minimum date values? Is there sample data available?

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

@v-mengzhu-msft Yes, that is correct. I have the measure for the current year, but need help with the measure for the prior year. I don't have a sample data, but I can work on something to post later today. 

 

Thank you. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors