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