Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I am trying to write an DAX that will give me the last date a rate changed. If you look at the below data the the unit has had two changes over the span of two years. I would like it to give me only the most recent date teh rate changed which is 12/1/2022.
This is the dax I wrote but it is giving me 1/1/2023 for all dates after 12/1/2023. Can someone help?
CALCULATE(
MAX(table[ Date]),
FILTER(
ALL(table),
table[unit]= EARLIER(table[unit])
&& table[rate] <> CALCULATE(LASTNONBLANK(table[rate],0), FILTER(ALL(table), table[Unit]= EARLIER(table[unit])))
))
Solved! Go to Solution.
hi @Anonymous
try to plot a card visual with a measure like:
Measure =
VAR _table =
ADDCOLUMNS(
TableName,
"Flag",
VAR _rate = [Rate]
VAR _date = [Date]
VAR _ratepre =
MAXX(
FILTER(ALL(TableName), TableName[Date] = EDATE(_date, -1) ),
TableName[Rate]
)
RETURN
IF( _rate<>_ratepre, "Yes", "No")
)
RETURN
MAXX(
FILTER(
_table,
[Flag]="Yes"
),
TableName[Date]
)
it worked like:
hi @Anonymous
then remove ALL, like:
Thanks for the response! I need this measure for a report I am trying to build. I dont think this formula is taking into account that there are multiple different unit number is my data set so it is only returning the max date in the file.
hi @Anonymous
then remove ALL, like:
hi @Anonymous
try to plot a card visual with a measure like:
Measure =
VAR _table =
ADDCOLUMNS(
TableName,
"Flag",
VAR _rate = [Rate]
VAR _date = [Date]
VAR _ratepre =
MAXX(
FILTER(ALL(TableName), TableName[Date] = EDATE(_date, -1) ),
TableName[Rate]
)
RETURN
IF( _rate<>_ratepre, "Yes", "No")
)
RETURN
MAXX(
FILTER(
_table,
[Flag]="Yes"
),
TableName[Date]
)
it worked like:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |