Forum Discussion
MatthewMcL
8 years agoFrequent Visitor
Transaction level date to Rolling Time Summary
Hello, I am very new to PowerBI, DAX and M Query but I am very familiar with general SQL Queries, Excel and general programming. I’ve been asked to develop something in powerbi and I’ve been hittin...
- Anonymous8 years ago
Hmm, not sure if you want to get the following results.
If it is, first create a calcuated column and use the following DAX to add Rank Number
Rank = RANKX(Sold,Sold[Date],,ASC,Dense)
Then, create another calucated column and use the DAX below to get the cumulative sum in 2 days by item name
2Days_Sum = CALCULATE(SUM(Sold[Sold]),ALLEXCEPT(Sold,Sold[Item Name]),Sold[Rank]<=EARLIER(Sold[Rank])&&Sold[Rank]>EARLIER(Sold[Rank])-2)
MatthewMcL
8 years agoFrequent Visitor
Hmm, I am still getting blank values after creating the Date Dimension table and linking it to the Date column in my dataset.
My Date Dimension table is just unique dates between the minimum date and maximum date within my original dataset.
2daysum = CALCULATE(
SUM(Sheet1[Sold]),
FILTER(ALL('DateTable'),'Sheet1'[Date]>=DateTable[Date]-2 && Sheet1[Date]<DateTable[Date]
))
Seward12533
Solution Sage
8 years agoPlease check two thing
- Date Table a conguous list of days (no missing days)
- Both the DATE Key in the Date Table and the Date Column in the Fact Table are rormatted to Date Only and Not Date/Time
I tested the same formula on a data set I have and worked as expected