Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hi everyone, I originally needed this code below (coupon or deal format) to apply conditional formatting when an item was on a deal/coupon depending on the date. However, I now need to modify this formula, with the same filters, to become a slicer based on yesterday's deals/coupons. The end goal is to create a metric that I can slice by coupon, deal, prime exclusive deal, lightning deal, etc. Thanks for your help!
Coupon or Deal Format =
VAR tempTable =
FILTER (
'Deals and Coupons',
'Deals and Coupons'[Coupon Start Date] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& 'Deals and Coupons'[Coupon End Date] >= 'Deals and Coupons'[Coupon End Date]
&& 'Deals and Coupons'[Deal Start Date] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& 'Deals and Coupons'[Deal End Date] >= 'Deals and Coupons'[Deal End Date]
&& 'Deals and Coupons'[Prime Exclusive Discount Start Date] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& 'Deals and Coupons'[Prime Exclusive Discount End Date] >= 'Deals and Coupons'[Prime Exclusive Discount End Date]
)
VAR MINIMUMDATE =
MINX ( tempTable, 'Deals and Coupons'[Coupon Start Date] )
VAR MAXIMUMDATE =
MAXX ( tempTable, 'Deals and Coupons'[Coupon End Date] )
VAR MINIMUMDATE2 =
MINX ( tempTable, 'Deals and Coupons'[Deal Start Date] )
VAR MAXIMUMDATE2 =
MAXX ( tempTable, 'Deals and Coupons'[Deal End Date] )
VAR MINIMUMDATE3 =
MINX ( tempTable, 'Deals and Coupons'[Prime Exclusive Discount Start Date] )
VAR MAXIMUMDATE3 =
MAXX ( tempTable, 'Deals and Coupons'[Prime Exclusive Discount End Date] )
VAR DATE2 =
MAXX ( tempTable, 'Deals and Coupons'[Lightning Deal Date] )
RETURN
IF (
AND (
SELECTEDVALUE ( 'Calendar'[Date] ) >= MINIMUMDATE,
SELECTEDVALUE ( 'Calendar'[Date] ) <= MAXIMUMDATE
),
"#A9F099",
IF (
AND (
SELECTEDVALUE ( 'Calendar'[Date] ) >= MINIMUMDATE2,
SELECTEDVALUE ( 'Calendar'[Date] ) <= MAXIMUMDATE2
),
"#97E6F8",
IF (
AND (
SELECTEDVALUE ( 'Calendar'[Date] ) >= MINIMUMDATE3,
SELECTEDVALUE ( 'Calendar'[Date] ) <= MAXIMUMDATE3
),
"#E6A1CB",
IF (
SELECTEDVALUE ( 'Calendar'[Date] ) = DATE2,
"#D1CEFF"
))))
Hi grbs,
Please explain more on what you want to achive with few more data, you can use the code you have posted only when you know where to plugin what
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 63 | |
| 49 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 122 | |
| 118 | |
| 38 | |
| 36 | |
| 29 |