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 Experts
How would you amend the following dax, so it gives me dates bewteen the follwoing ranges
1. 1 -7 days
2. 8 - 30 days
3 31 - 60 days
4 61 - 9 days
Solved! Go to Solution.
hi Boca
i solved the problem (see dax below)
Hi,
what would you like your result to look like? It seems like you want to create a new table, based on your date table, right?
I would try the following approach
DatePeriod = ADDCOLUMNS('Date', "Date Period",
IF(DATEDIFF(TODAY(), 'Date'[Date], DAY) <= 7, "1 - 7 days",
IF(DATEDIFF(TODAY(), 'Date'[Date], DAY) > 7 && DATEDIFF(TODAY(), 'Date'[Date], DAY) <= 30, "8 - 30 days",
...)))
Hi Boca
I would like to follow the same format i used in the my original dax but with your logic for the date ranges....i.e UNION etc...i am using the date ranges as a filter. i works just fine as normal but stuck on the element on how to add date ranges step into the current dax i am using.
Alright, gotcha.
It should work if you just delete the SUMMARIZE statement.
hi Boca
i solved the problem (see dax below)
The information you have provided is not making the problem clear to me. Can you please explain with an example.
Appreciate your Kudos.
Hi Amit
the first line of DAX is
Check if these can work
Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date',today()-7,7,day))
Rolling 7 to 14 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date',today()-14,7,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 |
---|---|
106 | |
102 | |
82 | |
62 | |
56 |
User | Count |
---|---|
253 | |
119 | |
115 | |
95 | |
70 |