POP a message when selected dates are more than 7 days.
- Bhawana Dawra
- Apr 28, 2023
- 1 min read
Let me introduce you to my data first which is pretty simple.
I have a table with products, category, units sold and date at which that particular product was sold.

I created a bar chart (units sold v/s category) and a date slicer.
I only want to show visual when selected number of days are less than or equal to 7.

Just above the visual a created a card which will be made visible/ transparent based on date difference. In the card pass a messsage measure in fileds.
Message = " Selected dates are more than 7 "

Create a DAX Measure to get date difference - Date diff = var _start = MIN(Sheet1[Date]) var _end = MAX(Sheet1[Date]) return DATEDIFF(_start,_end,DAY)+1
Create a flag to check if date difference is greater than or equal to 7 or not
ISok =
IF(int([Date diff])<=7, 1,0)
Using the flag measure create a new measure that will be used in background colour value of the card created over the bar chart.
Make Transparent ok check = IF( [ISok], "#FFFFFF00", "White" )
And one measure for the color of message in the card. Make transparent msg = IF( [ISok], "#FFFFFF00", "#A1343C" )

In the format tab of card visual select FX in the background colour and select make transparent ok check measure.
And format style as - Field Value


Put the measure Make tranparent message in Callout Value colour FX option.
And format style as - Field Value

And it's done ! Quite Easy right ?
You can go ahead and use these fundamentals to play around more with visibility.
Happy learning !
Comments