Forum Discussion
How to calculate the average difference between two measures doing a count on text values
Hi,
I have two measures currently doing a count on a text field shown below
Hi Anonymous ,
Based on your description, I have created a simple sample like this:
Please try:
Difference = var AverageApples = COUNTROWS(FILTER('Table',[Category]="Apple"))/(DATEDIFF(MIN([Date]),MAX([Date]),DAY)+1) var AveragePears = COUNTROWS(FILTER('Table',[Category]="Pear"))/(DATEDIFF(MIN([Date]),MAX([Date]),DAY)+1) Return AverageApples – AveragePearsOutput:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- v-jianboli-msft
Community Support
Hi Anonymous ,
Based on your description, I have created a simple sample like this:
Please try:
Difference = var AverageApples = COUNTROWS(FILTER('Table',[Category]="Apple"))/(DATEDIFF(MIN([Date]),MAX([Date]),DAY)+1) var AveragePears = COUNTROWS(FILTER('Table',[Category]="Pear"))/(DATEDIFF(MIN([Date]),MAX([Date]),DAY)+1) Return AverageApples – AveragePearsOutput:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi,
This worked perfectly, thank you!
- amitchandak
Super User
Anonymous , this is count, Avg based on what , Say Date, Month , Region, City etc.
Based on the need
Averagex(Values(Table[Month Year]), [Total Apples]) - Averagex(Values(Table[Month Year]), [Total Pears ])