Forum Discussion
nardtmo
Helper III
7 years agoNeed help weekly time base comparison power bi
Hello All, monitoring per hour and need to get the difference between today and last week same hour. see sample data below.
- 7 years ago
Hi nardtmo
You can add a column with below DAX Expression.Column = VAR pwd = DATEADD( YourTable[Date], -7, DAY ) RETURN YourTable[Books] - CALCULATE( SUM( YourTable[Books] ), ALLEXCEPT( YourTable, YourTable[Student ID], YourTable[Hour] ), YourTable[Date] = pwd )Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Mariusz
Community Champion
7 years agoHi nardtmo
You can add a column with below DAX Expression.
Column =
VAR pwd = DATEADD( YourTable[Date], -7, DAY )
RETURN
YourTable[Books] -
CALCULATE(
SUM( YourTable[Books] ),
ALLEXCEPT( YourTable, YourTable[Student ID], YourTable[Hour] ),
YourTable[Date] = pwd
)Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
nardtmo
Helper III
7 years agoMariuz,
thanks.. apologize for late reply.. I tried and for some reason calculated column resulting to current day values see attachment