Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Dear ,
I have below requirement,
| Date | Value | Result |
| 9/11/2020 | 1 | 1 |
| 9/12/2020 | 0 | 0 |
| 9/13/2020 | 0 | 0 |
| 9/14/2020 | 1 | 1 |
| 9/15/2020 | 1 | 2 |
| 9/16/2020 | 0 | 0 |
I have written below DAX and it's giving current value when i am choosing all dates. However, when i am slicing only two dates (Example: 09/13, 09/15), still result is taking only previous day value.
DAX
Prev Day Values = SWITCH(
Please let me know how to make this DAX dynamic irrespective of date slicer.
Example If I choose 09/13 and 09/15, then DAX should take read 09/13 instead of 09/14 for 09/15 row.
You cannot use PREVIOUSDAY(), you need to use MAX() or LASTNONBLANK with the condition that they be smaller than the current value. It's the standard "previous row" pattern.
Do you want help with the DAX for that?
Yes please, i would appreciate it.
How to change my current DAX to handle my requirement with MAX()?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |