The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All!
I'm trying to create measure that will contains average value of Price for previous 3 days.
I have done it in Excel, it is very simple formula.
How can I create a measure in Power BI Desktop for it?
Thanks in advance,
Alex.
Solved! Go to Solution.
Hi,
Try the below formula;
Measure = IF(COUNTROWS(DATESINPERIOD(Price[Date],LASTDATE(Price[Date]),-3,DAY))>2,CALCULATE(AVERAGE(Price[Price]),DATESINPERIOD(Price[Date],LASTDATE(Price[Date]),-3,DAY)))
Hi,
Try the below formula;
Measure = IF(COUNTROWS(DATESINPERIOD(Price[Date],LASTDATE(Price[Date]),-3,DAY))>2,CALCULATE(AVERAGE(Price[Price]),DATESINPERIOD(Price[Date],LASTDATE(Price[Date]),-3,DAY)))
It works fine!
Thank you so much!
Alex.
I created a table Price with fields Date & Price. Added the measure to get the last 3 days average
Measure = IF(COUNTROWS(DATESINPERIOD(Price[Date],LASTDATE(Price[Date]),-3,DAY))>2,CALCULATE(AVERAGE(Price[Price]),DATESINPERIOD(Price[Date],LASTDATE(Price[Date]),-3,DAY)))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
101 | |
82 | |
62 | |
56 |
User | Count |
---|---|
254 | |
119 | |
115 | |
100 | |
76 |