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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
imcdonald83
Regular Visitor

Previous date values

Hi Guys

 

Hoping you can maybe help. Im new to Power BI, and I have been working on some dashboard to help calculate the % shift of sales day on day. 

 

I have got it working to an extent by getting the previous dates value and working out the percentage diff between that and the current value. As the dates are not continious (working days only) it doesn't fully give me what im after.

 

Using the Dateadd function I have been able to return everything that is minus 1 day, but i would like it to return the value for the previous date regardless if it is continious date value. 

 

Prv Day Unused Limit = CALCULATE([Total Unused Limit],DATEADD(CARDS_DATES_POWERBI[date],-1,DAY))

 

pbi_screen.png

 

 

 Any thoughts?

1 ACCEPTED SOLUTION

Hi @imcdonald83,

 

Sorry for my mistake. Rather than a measure, we should create a calculated column using:

Pre = CALCULATE([Sales],CARDS_DATES_POWERBI[Date]=EARLIER(CARDS_DATES_POWERBI[predate]))

 

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.

View solution in original post

6 REPLIES 6
eric98
Helper II
Helper II

Today when I use your solution, it doesn't work

Anonymous
Not applicable

Yes, it didnt work for me either.

@eric98 create another post describing what you're trying to accomplish.  Include lots of details and provide some sample data for people to work with.

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @imcdonald83,

 

In your scenario, please first create a calculated column:

predate =
CALCULATE (
    MAX ([Date] ), FILTER ( CARDS_DATES_POWERBI, CARDS_DATES_POWERBI[Date] < EARLIER ( CARDS_DATES_POWERBI[Date] ) ) )

Then, create a measure:

Pre = CALCULATE([Sales],CARDS_DATES_POWERBI[Date]=EARLIER(CARDS_DATES_POWERBI[predate]))

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

@v-yulgu-msft

 

The creating of the predate column works fine, but the Earlier function is not recognising predate as part of a measure. 

 

EARLIER/EARLIEST refers to an earlier row context which doesn't exist.

Hi @imcdonald83,

 

Sorry for my mistake. Rather than a measure, we should create a calculated column using:

Pre = CALCULATE([Sales],CARDS_DATES_POWERBI[Date]=EARLIER(CARDS_DATES_POWERBI[predate]))

 

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.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.