Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi there.
It might sound simple, but I have been looking this solution up for quite a long time, almost everywhere on the internet, unsuccesfully, so far.
I would need something "dynamic", let's say, in the sense that I need to have the max value in the last 3 days, in the context of every row. Just like this:
calculate(max(Table[value]), filter(all(Table), Table[date] >= max(Table[date]) -3))
Or
calculate(max(Table[value]), filter(all(Table), Table[value] = max(Table[value]) && Table[date] >= max(Table[date]) -3))
None of the two solutions shown above are working for me.
The first one is giving "25" for every row. The second one is giving blank for every row.
I am writting the DAX formulas on Power Pivot, but I guess that's not the reason.
Any ideas?
Many thanks to everyone.
Solved! Go to Solution.
@zolotrip , Please find code for new column and measure
new column =
maxx(filter(Table, Table[date] >= earlier(Table[Date]) -3 && Table[date] <= earlier(Table[date])),[Table[value])
new measure =
maxx(filter(allselected(Table), Table[date] >= max(Table[Date]) -3 && Table[date] <= max(Table[date])),[Table[value])
Hi,
This pattern ought to do what you want:
End result:
I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!
Proud to be a Super User!
Dear @ValtteriN :
I don't have available the SELECTEDVAUE expression in Power Pivot, I'm afraid.
Do you know an equivalent to it?
Thank you so much.
Hi,
You can either use MAX it often works in a similar way or this pattern: IF(HASONEVALUE([column]), VALUES([column]), [alternateresult]).
Proud to be a Super User!
@zolotrip , Please find code for new column and measure
new column =
maxx(filter(Table, Table[date] >= earlier(Table[Date]) -3 && Table[date] <= earlier(Table[date])),[Table[value])
new measure =
maxx(filter(allselected(Table), Table[date] >= max(Table[Date]) -3 && Table[date] <= max(Table[date])),[Table[value])
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 |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |