Join 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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear all, I have the following table visual.
the column "Bal minus credit" is created by a measure.
I want the correspending date of the last negative value and would like to minus that date with a fixed date
for example "31-03-2024". How to achieve that? Appreciate help.
Hi,
Share the download link of the PBI file.
@Thulasiram , Create a date table, join with date of you table
Last Negative Date =
CALCULATE(
MAXX(filter(Values('Date'[Date]),[Bal minus credit] < 0), [Date]), filter( all('Date'), 'Date'[Date] <= Max('Date'[Date])
))
Date Difference =
VAR FixedDate = DATE(2024, 3, 31)
VAR LastNegDate = [Last Negative Date]
RETURN
DATEDIFF(LastNegDate, FixedDate, DAY)
or
Value Difference =
VAR LastNegDate = [Last Negative Date]
RETURN
[Closing Balanace] - calculate ([Closing Balanace] , filter( all('Date'), 'Date'[Date] = [Last Negative Date]))
hi @Thulasiram create these two Measures and let me know if you encounter into any issues.
Find the last negative value date:
LastNegativeDate =
CALCULATE(
MAX('Table'[Date]),
FILTER(
'Table',
'Table'[Bal minus credit] < 0
)
)
Difference between the last negative date and the fixed date:
DateDifference =
DATEDIFF(
[LastNegativeDate],
DATE(2024, 3, 31),
DAY
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |