Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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))
Any thoughts?
Solved! Go to 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
Today when I use your solution, it doesn't work
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.
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
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
User | Count |
---|---|
78 | |
74 | |
41 | |
31 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |