Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi folks, i am playing around the DAX and came across this issue. So the calculated column should return the case number of last day of the same county. It works fine for the first few rows but the stops changing after. But if I returned the date, it works prefect. Why would this happened? Please advised. Thank you!
Solved! Go to Solution.
please try this
Column =
VAR _date=MAXX(FILTER('Table','Table'[countryFIPS]=EARLIER('Table'[countryFIPS])&&'Table'[State]=EARLIER('Table'[State])&&'Table'[date]<EARLIER('Table'[date])),'Table'[date])
return MAXX(FILTER('Table','Table'[countryFIPS]=EARLIER('Table'[countryFIPS])&&'Table'[State]=EARLIER('Table'[State])&&'Table'[date]=_date),'Table'[cases])Proud to be a Super User!
please try this
Column =
VAR _date=MAXX(FILTER('Table','Table'[countryFIPS]=EARLIER('Table'[countryFIPS])&&'Table'[State]=EARLIER('Table'[State])&&'Table'[date]<EARLIER('Table'[date])),'Table'[date])
return MAXX(FILTER('Table','Table'[countryFIPS]=EARLIER('Table'[countryFIPS])&&'Table'[State]=EARLIER('Table'[State])&&'Table'[date]=_date),'Table'[cases])Proud to be a Super User!
Hi @ronlolololo ,
It is because your date column is ranking ascending,so using your expression can get the result you need,but if your date column is disordering,then you will get a wrong return,such as your case number.
The best solution is to create an index column.
I made a simple sample,pls see attached.
@ronlolololo - Difficult to say. Please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 21 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 59 | |
| 53 | |
| 41 | |
| 31 | |
| 26 |