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.
I have below data and I would like to calculate Average sales county and month, I have converted date as Month slicer which looks like May 2020, May 2021, June 1988, Feb 2020 (DD/MM/YYYY)
ID Country Date Sales
1 USA 1/2/2020 100
2 USA 2/2/2020 200
The average will be (100+200)divide 2 = 150
ID Country Date Sales
1 USA 1/2/2020 100
2 USA 2/2/2020 200
3 SPAIN 2/05/2020 300
4SPAIN 4/6/1988 100
I tried below DAX but was not filtering properly when you click two months slicer
I would like to slice (Slicer) the data by country and Month from date column to be able to get the correct Average even when two months i.e June 1988, Feb 2020 are selected.
Thanks
Solved! Go to Solution.
Hi , @MYDATASTORY
Try to create a calculate column first:
Year_month = FORMAT('Sales Table'[Date ],"MMM yy")
Then create a measure as below:
Avg = CALCULATE(AVERAGE('Sales Table'[Sales]),ALLEXCEPT('Sales Table','Sales Table'[Country],'Sales Table'[Year_month]))
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , @MYDATASTORY
Try to create a calculate column first:
Year_month = FORMAT('Sales Table'[Date ],"MMM yy")
Then create a measure as below:
Avg = CALCULATE(AVERAGE('Sales Table'[Sales]),ALLEXCEPT('Sales Table','Sales Table'[Country],'Sales Table'[Year_month]))
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
108 | |
98 | |
81 | |
65 | |
62 |
User | Count |
---|---|
147 | |
116 | |
104 | |
88 | |
65 |