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.
Hello everybody,
I hope you all are very good!!!
I have a Table with dates, and I want to filter only the last ten days... So I need a filter in my report that shows "Last ten days". What I was doing is a new column in the table with the next formula:
The formula should put "Last 10 days" in all the yellow dates (10 dates), and in the other dates it should put the date.
Any workaround for this?
Thanks a lot. Best regards,
Chema Ortega
Solved! Go to Solution.
A simple formula as below should work
Date Category =
IF (
'NexThing Files'[Loaded Date]
>= MAX ( 'NexThing Files'[Loaded Date] ) - 9,
"Last 10 days",
FORMAT ( 'NexThing Files'[Loaded Date], "dd/mm/yyyy" )
)
Note. if you intend to use the calculated column in a slicer, the values will be sorted alphabetically so the dates will ot be in the correct order. Add another calc column to sort it by.
Date Category Sort =
IF (
'NexThing Files'[Loaded Date]
>= MAX ( 'NexThing Files'[Loaded Date] ) - 9,
1,
'NexThing Files'[Loaded Date]
)
Date Category Sort =
IF (
'NexThing Files'[Loaded Date]
>= MAX ( 'NexThing Files'[Loaded Date] ) - 9,
100000,
'NexThing Files'[Loaded Date]
)
Try to use filter for this visual or page or all pages on filter pane
A simple formula as below should work
Date Category =
IF (
'NexThing Files'[Loaded Date]
>= MAX ( 'NexThing Files'[Loaded Date] ) - 9,
"Last 10 days",
FORMAT ( 'NexThing Files'[Loaded Date], "dd/mm/yyyy" )
)
Note. if you intend to use the calculated column in a slicer, the values will be sorted alphabetically so the dates will ot be in the correct order. Add another calc column to sort it by.
Date Category Sort =
IF (
'NexThing Files'[Loaded Date]
>= MAX ( 'NexThing Files'[Loaded Date] ) - 9,
1,
'NexThing Files'[Loaded Date]
)
Date Category Sort =
IF (
'NexThing Files'[Loaded Date]
>= MAX ( 'NexThing Files'[Loaded Date] ) - 9,
100000,
'NexThing Files'[Loaded Date]
)
Hi Danextian... Thanks a lot! Thats what I needed! That is the solution... that's GREAT! Best regards
Use the below dax:
Loaded Date 5 =
IF(
'NexThing Files'[dataDate] >= (MAX('NexThing Files'[dataDate]) - 9)
&& 'NexThing Files'[dataDate] <= MAX('NexThing Files'[dataDate]),
"Last 10 Days",
FORMAT('NexThing Files'[dataDate], "dd/mm/yyyy")
)
Hi Angith,
Thanks a lot! That also works great! Thanks a lot. Best regard!
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 |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |