Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi there,
I want to show the 5 previous months and the current one without using a slicer and update it automatically.
Data example bellow (assuming that Frebruary is the current month, I want to see the marked months and the current one);
Try
Var _This_year(max(ENDOFMonth('Date'[Date Filer])) // OR use today Var _This_year=today() Var _min_This_year= (maxx('Date',STARTOMONTH(DATEADD('Date'[Date Filer],-5,MONTH)))) Var _This_year_val =CALCULATE(sum(Sales[Sales Amount]),(Sales[Sales Date])<=_This_year && (Sales[Sales Date]) >=_min_This_year)
Or You can also refer https://community.powerbi.com/t5/Desktop/Sum-of-the-amount-of-sales-the-previous-5-months/m-p/808469...
@amitchandak wrote:Try
Var _This_year(max(ENDOFMonth('Date'[Date Filer])) // OR use today Var _This_year=today() Var _min_This_year= (maxx('Date',STARTOMONTH(DATEADD('Date'[Date Filer],-5,MONTH)))) Var _This_year_val =CALCULATE(sum(Sales[Sales Amount]),(Sales[Sales Date])<=_This_year && (Sales[Sales Date]) >=_min_This_year)
User | Count |
---|---|
127 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |