Forum Discussion
Extract today's data from the previous date
Ok, you don't need to add a new column to the table. Upload the data and then create the measure:
Today Value = SUM(COVID[Value]) - CALCULATE(SUM(COVID[Value]),PREVIOUSDAY(COVID[Date]))
Create a visual: table or matrix or chart, add a Date column and Today Value measure there.
This measure will always return a value for the selected day.
_______________
If I helped, please accept the solution and give kudos! 😀
thanks thats great, but wont work in case i want to see new column, i need each date to be subvstract from the prev date till the end of my data which should be till 21st Jan.
Thus said, 26 aug-25 aug data, 25 aug- 24 aug, 24 aug-23 aug, etc.
in that manner i would like to see the data, thats what im looking for.
- v-lili6-msft6 years agoCommunity Support
hi Mehay
You could try this logic to create a new calculate column:
Daily Cases = var _lastdate=CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Country]),'Table'[Date]<EARLIER('Table'[Date]))) return 'Table'[Value]-CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Country]),'Table'[Date]=_lastdate))If not your case, please share your sample pbix file and your expected output.
Regards,
Lin