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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
hi,
I want to compare two different dates from the same tables
Example:
Below is my table
| Meter | date | Cost |
| ADB | 12-6-2022 | 23.45 |
| ADF | 12-6-2022 | 34.56 |
| Storage | 12-6-2022 | 14.56 |
| ADB | 12-8-2022 | 12 |
| ADF | 12-8-2022 | 23.45 |
| Storage | 12-8-2022 | 45.6 |
I want to compare the cost for these two dates such that my output is like this.
| Meter | PreviousCost | NewCost |
| ADB | 23.45 | 12 |
| ADF | 34.56 | 23.45 |
I want to compare dates on the dashboard
Solved! Go to Solution.
Hi @Anonymous ,
Create a new table for user to select the previous date via PreviousDate = VALUES('Table'[date])
Then use this measure to get the values of previous date.
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @amitchandak ,
Actually, I want a date filter in the dashboard wherein users can select any 2 days, by which they can compare costs on the selected two days.
Hi @Anonymous ,
Create a new table for user to select the previous date via PreviousDate = VALUES('Table'[date])
Then use this measure to get the values of previous date.
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-chenwuz-msft , how can I only show the last 3 months dates in the date filter?
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Those are for creating new measures.
Previous cost measure: =
VAR _latestdate =
MAX ( Data[date] )
VAR _previousdate =
CALCULATE ( MAX ( Data[date] ), Data[date] < _latestdate )
VAR _previouscost =
CALCULATE ( MAX ( Data[Cost] ), Data[date] = _previousdate )
RETURN
IF ( HASONEVALUE ( Data[Meter] ), _previouscost )
New cost measure: =
VAR _latestdate =
MAX ( Data[date] )
VAR _latestcost =
CALCULATE ( MAX ( Data[Cost] ), Data[date] = _latestdate )
RETURN
IF ( HASONEVALUE ( Data[Meter] ), _latestcost )
hi @Jihwan_Kim , will this also work if I select two different dates from a filter via dashboard?
Hi,
Thank you for your feedback.
I cannot know without seeing your data model.
Please share your sample pbix file's link here, and then I can try to have a look into it.
Thanks.
hi @Jihwan_Kim , my table is a single table, with columns meter category, SubscriptionName, date, cost_usd.
@Anonymous , for meausre you can have
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
or
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =calculate( max(Sales[Sales Date]), FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])))))
or refer
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 56 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 24 |