I have a Power BI table looks like this:
Cat sales Date
apple 2.0 03/18/2021
apple 1.8 03/19/2021
apple 2.0 03/20/2021
apple 2.5 03/21/2021
peach 3.1 03/18/2021
peach 3.0 03/19/2021
peach 1.7 03/20/2021
peach 2.0 03/21/2021
pear 4.2 03/18/2021
pear 4.4 03/19/2021
pear 3.9 03/20/2021
pear 4.9 03/21/2021
I want to use a date slicer and Cat filter to calculate the (average sales)/(standard deviation of sales) during a period and display in a tile:
For example: Slicer select: Apple and Pear Date Slicer: 03/18/2021 - 03/20/2021
Formula:
Step 1: Average = (6.2 + 6.2 + 5.9) = 6.1
03/18/2021 2+4.2= 6.2
03/19/2021 1.8+4.4 = 6.2
03/20/2021 2+3.9 = 5.9
Step 2: Stdev(6.2,6.2,5.9) = 0.1732
Step 3: Average/Stdev = 6.1/0.1732 = 35.22
Tile display: 35.22
I am new to DAX and wasn't able to figure out the right formula, Please help!