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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors