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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Calculated Column of Sum of Score divided count of distinct Projects

Hi All,

 

I want a calculated column such that total Count of distinct "WS Id" must divide the total Sum of "Average SPE Scores" corresponding to distinct WS Id as shown in the screenshot. The expected results must be that corresponding to each distinct WS Id in a single row the value of calculated column must be displayed in the same row instead of different rows.

sha009_0-1652359333909.png

Thanks in Advance !!!

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

Flag =
var _Countofdistinct=CALCULATE(DISTINCTCOUNT('Table'[WS Id]),FILTER(ALL('Table'),[GUID]=EARLIER('Table'[GUID])))
var _thetotalSum=SUMX(FILTER(ALL('Table'),'Table'[WS Id]=EARLIER('Table'[WS Id])),[Average SPE Scores])
return
DIVIDE(
    _Countofdistinct,_thetotalSum)

2. Result:

vyangliumsft_0-1652850195541.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

Flag =
var _Countofdistinct=CALCULATE(DISTINCTCOUNT('Table'[WS Id]),FILTER(ALL('Table'),[GUID]=EARLIER('Table'[GUID])))
var _thetotalSum=SUMX(FILTER(ALL('Table'),'Table'[WS Id]=EARLIER('Table'[WS Id])),[Average SPE Scores])
return
DIVIDE(
    _Countofdistinct,_thetotalSum)

2. Result:

vyangliumsft_0-1652850195541.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

amitchandak
Super User
Super User

@Anonymous ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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