Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have data from UB. They release info twice a week. Highs and Lows for each category (1-2, 2-3...)
I have it in excel and I am trying to replicate it on Power BI.UB
For the Change column I tried:
Solved! Go to Solution.
HI @Anonymous,
You can try to use the following measure formula to get the difference between current and previous(not continues) based on the current category group:
Change Previous Day =
VAR currDate =
MAX ( 'UB Data'[Date] )
VAR prevDate =
CALCULATE (
MAX ( 'UB Data'[Date] ),
FILTER ( ALLSELECTED ( 'UB Data' ), [Date] < currDate ),
VALUES ( 'UB Data'[Size] )
)
VAR PDChange =
CALCULATE (
[Last value],
FILTER ( ALLSELECTED ( 'UB Data' ), [Date] = prevDate ),
VALUES ( 'UB Data'[Size] )
)
RETURN
[Last value] - PDChange
Regards,
Xiaoxin Sheng
@Anonymous , Th formula should be like this. Mark calendar as a date table, use period from calendar table in slicer and visual
Last value =
CALCULATE (
SUM ( 'UB Data'[Price] ),PREVIOUSDAY('Calendar'[Date]))
but if the dates are not continuous
then
example
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =calculate( max(Sales[Sales Date]), FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])))))
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c3243d1f9
I appreciated your time. Thanks.
But my issue was not in finding the last day. The dates are not continuous, and I need to find the difference between the last day and the previous day (it varies between 2 and 6 days before). That is where I am struggling.
HI @Anonymous,
You can try to use the following measure formula to get the difference between current and previous(not continues) based on the current category group:
Change Previous Day =
VAR currDate =
MAX ( 'UB Data'[Date] )
VAR prevDate =
CALCULATE (
MAX ( 'UB Data'[Date] ),
FILTER ( ALLSELECTED ( 'UB Data' ), [Date] < currDate ),
VALUES ( 'UB Data'[Size] )
)
VAR PDChange =
CALCULATE (
[Last value],
FILTER ( ALLSELECTED ( 'UB Data' ), [Date] = prevDate ),
VALUES ( 'UB Data'[Size] )
)
RETURN
[Last value] - PDChange
Regards,
Xiaoxin Sheng
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
78 | |
64 | |
45 | |
40 | |
40 |