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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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] )

Regards
Zubair

Please try my custom visuals

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] )

Regards
Zubair

Please try my custom visuals

@theitguy

 

File attached too

 

Grouped.png


Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors