Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
xv
Frequent Visitor

dates column disconnected from measure

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);

 

Captura.GIF

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GilbertQ
Super User
Super User

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...





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors