Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
I have a Sales table like below, I want to create a measure for the last 10 days. Since I don't have data for 01-Apr-2023 so it should consider 23-Mar-23 as my 10th day.
Note that my dates can be changed so I want a dynamic measure
| Date | Amount |
| 20-Mar-23 | 10 |
| 21-Mar-23 | 3 |
| 22-Mar-23 | 6 |
| 23-Mar-23 | 5 |
| 02-Apr-23 | 6 |
| 03-Apr-23 | 4 |
| 04-Apr-23 | 2 |
| 05-Apr-23 | 3 |
| 06-Apr-23 | 10 |
| 07-Apr-23 | 5 |
| 08-Apr-23 | 8 |
| 09-Apr-23 | 7 |
| 10-Apr-23 | 6 |
Solved! Go to Solution.
Ah okay,
if you wrap the rank measure in a filter to calculate the amount based on the rank that is less than 10, that should work. try this:
Hi,
You may download my PBI file from here.
Hope this helps.
Thanks, DOLEARY85 for a quick response.
Please note that I'd like to use a card to show the total sales amount which is less then N
How to achieve that?
I'm assuming you want the N value to be selectable, if that's the case: could you just use a simple measure to calculate the sum of the amount for the card:
Hi DOLEARY85, I'd like to use it within a measure so no need to apply slicer or filter.
Hi DOLEARY85, Basically I'd like to calculate the last 10 days' sales and show them on a card without any slicer or a filter.
Ah okay,
if you wrap the rank measure in a filter to calculate the amount based on the rank that is less than 10, that should work. try this:
Hi,
You could create a ranking that works dynamically and then use it on the filters on this visual in tha table
hope that helps
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 19 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 52 | |
| 38 | |
| 31 | |
| 27 |