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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors