Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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)
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))
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 33 | |
| 33 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 45 | |
| 30 | |
| 26 |