Forum Discussion
Sum and average based on selection
- Anonymous3 years ago
Hi Balhemkan ,
The measure calculates based on the date column. There is no date on the card so that it is blank. You can use KPI visual to show.
Or use another measure in the card.
Measure2 = VAR _min = MIN ( 'Table'[Date] ) VAR _max = MAX ( 'Table'[Date] ) VAR _sales = CALCULATE ( SUM ( volume[Sales] ), FILTER ( volume, volume[month] = MONTH ( _min ) ) ) VAR _diff = DATEDIFF ( _min, _max, MONTH ) + 1 RETURN _sales / _diffBest Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I mean if only one month is selected in slicer then sum of that month. If two months selected in slicer sum of 1st +sum of 2nd month average we want.
Could you please suggest on this
- Jihwan_Kim3 years agoSuper User
Hi,
I think my sample does not suit your inquiry. Could you please share your sample pbix file's link (onedrive, googledrive, dropbox, any others) here, and also the desired result, and then I can try to look into it to come up with a more accurate solution.
Thanks.
- Balhemkan3 years agoHelper III
Hi Jihwan_Kim
Actually your measure is right but for my dataset it is not working. I have attached pbix. Could you please help me dax in that file.Pbix Attachment - Balhemkan3 years agoHelper III
Hi,
Sorry to bother you. Do you have any update on pbix. I'm completely depending on you.
- Jihwan_Kim3 years agoSuper User
Hi,
Thank you for your shring the link.
I checked your sample, but I am not sure if it looks like below.
If so, I think the measure shows the correct number.
Or, could you please describe what numbers you want to see as a result?