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! Request now
Thanks to everybody for your help.
Currently, I've got a table (PH) that is composed of a date column, and an agent column that represent the total of stocks of some item for this agent. Each row of the table represents the current stock for this date, and each date has an irregular frequency (traditional time intelligence discard).
What I'm trying to achieve is to get the variation in each date, by taking the consecutive difference between in stocks between periods.
All were very happy by using earlier, getting the previous date by getting the maximum value for the dates in the previous row context.
calculate(max(PH[dates]),FILTER(PH,PH[dates] < EARLIER(PH[dates])))
Then, my next step would use the previous code for calculating the total stock for each date on a measure:
CALCULATE(sum(PH[agent]),FILTER(PH,calculate(max(PH[date]),FILTER(PH,PH[date] < EARLIER(PH[date])))))
Wonderful, it calculates the total for all the dates BUT now, if I set the dates columns in the axis filter (line chart), it's empty. As if it could not set the dates for each day, although if it can calculate the value added to the interior of a sum when the date column is not present.
What could be the problem? I appreciate any help.
Notes: The data model has a data table, that is related to the date column of PH.
This is an example of what I get (the total is correct, but for each date, it doesn't retrieve any data);
Hi @xv,
As guavaq suggested, please provide sample data from your data model. To help us better understand your requirement and test for you, please illustrate your scenario with examples or images of your expected result.
By the way, in a measure, we cannot use ERALIER function. Instead, we can replace EARLIER(PH[date]) with MAX(PH[date]).
Regards,
Yuliana Gu
Hi @xv
Do you have some sample data that we could look at to see both the data and then the expected output?
The one thing that I always do when working with dates is to have a Date table. This enables the Time Intelligence functions to work, even when there is no data for a date.
Here is a blog post on how to create the Date Table: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fi...
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 48 | |
| 45 |