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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dgilm33
Helper I
Helper I

Showing a caption if a date in the last 6 months has been selected

Hi all,

 

I am having trouble with something that is probably simple. I have a date column I use in a slicer so users can select the range they want to see sales for. The issue is, the sales are typically allocated at the end of the month and not everyday. So, if a user is selected to 8/1/22 - 8/16/23, 8/23 sales would not be shown. 

I've been asked to show a caption if a user is selected to a date in the most recent 6 months, regardless of when the sales are allocated. So currently anything selected to 9/1/23 would result in the caption showing. How could I make a measure to show if the selected value in the date slicer is >= 9/1/23 and <= 3/3/24, yes, else no for example?

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @dgilm33 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

DateTable = CALENDAR(DATE(2023,1,1),TODAY())

(2) We can create a measure. 

Measure = IF(
ISFILTERED('DateTable'[Date])=FALSE(),BLANK(),IF(
MIN('DateTable'[Date])>=EDATE(TODAY(),-6) && MAX('DateTable'[Date])<=TODAY(),"yes","no"))

(3) Setting the conditional format and then the result is as follows.

vtangjiemsft_0-1709533805895.png

vtangjiemsft_1-1709533852160.png

vtangjiemsft_2-1709533880450.pngvtangjiemsft_3-1709533897969.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @dgilm33 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.  

DateTable = CALENDAR(DATE(2023,1,1),TODAY())

(2) We can create a measure. 

Measure = IF(
ISFILTERED('DateTable'[Date])=FALSE(),BLANK(),IF(
MIN('DateTable'[Date])>=EDATE(TODAY(),-6) && MAX('DateTable'[Date])<=TODAY(),"yes","no"))

(3) Setting the conditional format and then the result is as follows.

vtangjiemsft_0-1709533805895.png

vtangjiemsft_1-1709533852160.png

vtangjiemsft_2-1709533880450.pngvtangjiemsft_3-1709533897969.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.