Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have this simple scenario where I need to calculate a rolling past 5 months (not including the current month) for a given transaction.
I have a Date table and link it to my transaction table. For unknown reason, the graph displays a sixth bar instead of 5.
Could someone help to get this fixed?
The DAX script is:
TY Actions =
VAR EndDate =
EOMONTH ( TODAY (), -1 )
VAR StartDate = EDATE ( EOMONTH ( TODAY (), -1 ), -5 ) +1
RETURN
CALCULATE (
SUM(UserActions[t_UserActions]),
CALCULATETABLE ( 'Date', FILTER ( 'Date', 'Date'[Date] >= StartDate && 'Date'[Date] <= EndDate ) ) )
Many thanks,
Guy
Solved! Go to Solution.
@Anonymous , Try a measure like
TY Actions =
VAR EndDate =
EOMONTH ( TODAY (), -1 )
VAR StartDate = EOMONTH ( TODAY (), -6 ) +1
RETURN
CALCULATE (
SUM(UserActions[t_UserActions]),FILTER ( 'Date', 'Date'[Date] >= StartDate && 'Date'[Date] <= EndDate ) )
@Anonymous , Try a measure like
TY Actions =
VAR EndDate =
EOMONTH ( TODAY (), -1 )
VAR StartDate = EOMONTH ( TODAY (), -6 ) +1
RETURN
CALCULATE (
SUM(UserActions[t_UserActions]),FILTER ( 'Date', 'Date'[Date] >= StartDate && 'Date'[Date] <= EndDate ) )
Brilliant! Thanks a lot.
User | Count |
---|---|
96 | |
85 | |
77 | |
66 | |
63 |
User | Count |
---|---|
110 | |
96 | |
96 | |
67 | |
59 |