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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
theitguy
Helper I
Helper I

Calculation on Grouped Values

Hi guys,

 

I would like to create a measure which calculates the standard derivation of sums from a group-by action.

 

I have the following table:

launch_history_idDateSeconds_SpendScoreParticipant_ID
2248417-11-20174440,6Learner1
2477123-11-2017240Learner1
2477323-11-20179740,57Learner1
2247017-11-20174391Learner1
2480123-11-201710Learner1
2243517-11-2017840Learner2
2331920-11-2017280Learner2
2331720-11-2017720Learner2
2248317-11-20173730,5Learner2
2248117-11-2017100Learner2
2248717-11-20172250Learner3
2487823-11-20171481Learner4
2488623-11-201741Learner4
2488723-11-201700Learner4
2490223-11-2017150Learner4
2490523-11-20171410Learner4
2492023-11-2017531Learner4
2492123-11-201741Learner4
2232317-11-2017170Learner4
2492423-11-20171831Learner4
2493123-11-201731Learner4
2492923-11-2017480Learner4
2493223-11-2017940Learner4
2245617-11-20178361Learner4
2233217-11-20174110Learner5
2243417-11-20171500,0204082Learner6

 

First,I would like to group this data by Participant_ID and sum the seconds spend to get someting like that:

Learner11882
Learner2567
Learner3225
Learner41546
Learner5411
Learner6150

 

Now I would like to calculate the standard derivation for these values. (STD:669,07)

Can I do this with the help of a single measure?

 

Thank you!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @theitguy

 

Try this MEASURE

 

Measure =
VAR MyColumn =
    SUMMARIZE (
        TableName,
        TableName[Participant_ID],
        "TotalSeconds", SUM ( TableName[Seconds_Spend] )
    )
RETURN
    STDEVX.P ( MyColumn, [TotalSeconds] )

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

HI @theitguy

 

Try this MEASURE

 

Measure =
VAR MyColumn =
    SUMMARIZE (
        TableName,
        TableName[Participant_ID],
        "TotalSeconds", SUM ( TableName[Seconds_Spend] )
    )
RETURN
    STDEVX.P ( MyColumn, [TotalSeconds] )

@Zubair_Muhammad

 

Thank you very much! I did not know that I can assign tables to variables as well. 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.