Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

standard deviation for grouped data

Hello 

 

I have a question and appreciate it if you answer.

 

I have a table in which the data for sales of different products has been stored daily.

to elaborate more:

each day, the number of sold products is different and for some products, it may be 0 sales.

 

what I want:

 

I want to calculate the standard deviation. it would be a one constant number. I want to show the std of #number of sold products as a constant line in the line chart over time.

I tried to this dax codes:

Var e= SUMMARIZE('Reports sale','Reports sale'[Date],"sum1",(sum('Reports sale'[productssold])))
VAR f=CALCULATE(STDEVX.P(e,[sum1]),all(e))
return(f)
 
I appreicate it if you answer my question

 

 

4 REPLIES 4
johnt75
Super User
Super User

Try

Standard dev all time =
VAR summaryTable =
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE ( 'Reports sale', 'Reports sale'[Date] ),
            "@sales", CALCULATE ( SUM ( 'Reports sale'[productssold] ) )
        ),
        REMOVEFILTERS ( 'Reports sale'[Date] )
    )
RETURN
    STDEVX.P ( summaryTable, [@sales] )
Anonymous
Not applicable

hi johnt75

 

Thanks for your response .

I tried your solution, But It does not give me the constant number; when I tried to show it on the table, the std value cahnges over time , and when I drill down to day it becomes 0 . 

aaa.png

 

Anonymous
Not applicable

from report[date] table .

Which table is the Month / Day in your table visual coming from ?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.