cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
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.

3 REPLIES 3
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.

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

Helper I

@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.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.