Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |