Forum Discussion
ckhoo2007
Helper I
5 years agoAverageX with Date Slicer
Hi All,
I have a sample data as follow,
| Date | Client | Average Sales | Transactions |
| 4/5/2021 | A | 811.53 | 5 |
| 3/5/2021 | A | 705.08 | 9 |
| 29/4/2021 | B | 701.98 | 1 |
| 3/5/2021 | C | 581.45 | 2 |
| 7/5/2021 | A | 570.29 | 19 |
| 5/5/2021 | A | 555.56 | 17 |
| 28/3/2021 | D | 552.59 | 1 |
| 28/3/2021 | E | 547.89 | 1 |
I wanted to calculate for each client the average of (Average Sales * Transactions)/ Sum of Transactions for a certain range of date based on a date slicer, I have tried:
DIVIDE(AVERAGEX(Sales,Sales[Average Sales]*Sales[Transactions]),SUM(Sales[Transactions]))
but it doesn't seems to segragate by Client/ Date slicer.....
I already have a Date table with relationship created to the Sales table.
Appreciate your advise on the right formula, thanks.
Regards.
Choo
- Anonymous5 years ago
HI ckhoo2007,
You can try to use the following measure formula if helps:
Masure = DIVIDE ( AVERAGEX ( SUMMARIZE ( ALLSELECTED ( Sales ), [Date], [Client], "Rate", Sales[Average Sales] * Sales[Transactions] ), [Rate] ), SUM ( Sales[Transactions] ) )Regards,
Xiaoxin Sheng
2 Replies
- AnonymousNot applicable
HI ckhoo2007,
You can try to use the following measure formula if helps:
Masure = DIVIDE ( AVERAGEX ( SUMMARIZE ( ALLSELECTED ( Sales ), [Date], [Client], "Rate", Sales[Average Sales] * Sales[Transactions] ), [Rate] ), SUM ( Sales[Transactions] ) )Regards,
Xiaoxin Sheng
- ckhoo2007
Helper I
Thanks XiaoXin!