cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
theitguy Regular Visitor
Regular Visitor

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

Accepted Solutions
Super User III
Super User III

Re: Calculation on Grouped Values

HI @theitguy

 

Try this MEASURE

 

Measure =
VAR MyColumn =
    SUMMARIZE (
        TableName,
        TableName[Participant_ID],
        "TotalSeconds", SUM ( TableName[Seconds_Spend] )
    )
RETURN
    STDEVX.P ( MyColumn, [TotalSeconds] )
Try my new Power BI game Cross the River

View solution in original post

3 REPLIES 3
Super User III
Super User III

Re: Calculation on Grouped Values

HI @theitguy

 

Try this MEASURE

 

Measure =
VAR MyColumn =
    SUMMARIZE (
        TableName,
        TableName[Participant_ID],
        "TotalSeconds", SUM ( TableName[Seconds_Spend] )
    )
RETURN
    STDEVX.P ( MyColumn, [TotalSeconds] )
Try my new Power BI game Cross the River

View solution in original post

Super User III
Super User III

Re: Calculation on Grouped Values

@theitguy

 

File attached too

 

Grouped.png

Try my new Power BI game Cross the River
theitguy Regular Visitor
Regular Visitor

Re: Calculation on Grouped Values

@Zubair_Muhammad

 

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors