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
I have a dataset as below :
Month Day of Month Values Distinct count of days Total(Values) Average= Total(Values)/Distinct count of days
1 1 20 2 50 50/2
1 2 30 2 50 50/2
2 1 30 2 70 70/2
2 2 40 2 70 70/2
I want to calculate average for every month on basis of filter selection . For example :
If user selects 1 and 2 Day of Month from Month-1 and 1 and 2 Day of Month from Month-2 . The above total should calculate as shown.
I am able to achieve distinct count of days with this formula -
Solved! Go to Solution.
hi, @Anonymous
You could try these three formulas as below:
Distinct count of days = CALCULATE(DISTINCTCOUNT('Table'[DAY_OF_MONTH]),ALLSELECTED('Table'[DAY_OF_MONTH])) Total(Values) = CALCULATE(SUM('Table'[Values]),ALLSELECTED('Table'[DAY_OF_MONTH])) Average = [Total(Values)]/[Distinct count of days]
Result:
and here is pbix, please try it.
Best Regards,
Lin
hi, @Anonymous
You could try these three formulas as below:
Distinct count of days = CALCULATE(DISTINCTCOUNT('Table'[DAY_OF_MONTH]),ALLSELECTED('Table'[DAY_OF_MONTH])) Total(Values) = CALCULATE(SUM('Table'[Values]),ALLSELECTED('Table'[DAY_OF_MONTH])) Average = [Total(Values)]/[Distinct count of days]
Result:
and here is pbix, please try it.
Best Regards,
Lin
Thanks a lot Lin. 🙂
This Solution worked for me.
Hello,
See image I've attached and tell us if works for you.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |