Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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))
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
98 | |
96 | |
68 | |
67 |