Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi, I have the below measure which calculates the number of days between two dates filtered by the datebetween function. I only want to show this measure when it falls between the dates provided in DateBetween. This works until I add the +1, then it provides a value against all dates (see image). How do I add 1 without breaking the filter?
MEASURE Charge[RentalDaysUsed] =
CALCULATE (
DATEDIFF ( [CurrentRentalFromDate], MAX ( Charge[dtChargeDate1] ), DAY ) + 1,
DATESBETWEEN (
Charge[dtChargeDate1],
[CurrentRentalFromDate],
MAX ( Charge[dtChargeDate1] )
)
)
Solved! Go to Solution.
Thansk for the reply but I fixed this by adding a FILTER instead of the DATESBETWEEN:
Thansk for the reply but I fixed this by adding a FILTER instead of the DATESBETWEEN:
Hi @gclements ,
You could try something like this:
Charge[RentalDaysUsed] =
VAR __daysUsed =
CALCULATE(
DATEDIFF(
[CurrentRentalFromDate],
MAX(Charge[dtChargeDate1]),
DAY
),
DATESBETWEEN(
Charge[dtChargeDate1],
[CurrentRentalFromDate],
MAX(Charge[dtChargeDate1])
)
)
RETURN
SWITCH(
TRUE(),
ISBLANK(__daysUsed), BLANK(),
__daysUsed + 1
)
Not the most elegant solution, but should get you over the line.
Pete
Proud to be a Datanaut!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 32 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 58 | |
| 31 | |
| 25 | |
| 24 |