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
heidibb
Helper IV
Helper IV

Create Index Score - divide row score by total of column

Hello,

 

I am trying to create a measure that will give me an index score on each row.

 

In the attached picture, I have average score and max hits. I have created each row's "score" by dividing the max hits by avg score. I would like to then create a sort of index by dividing THAT score by the column total value (285.64 in this example). So the first row would essentially have an index score of 1.6 (457.26/285.64), the second row would have an index score of 1.2 (333.91/285.64).

 

Wondering if there is a formula that I can use to do this?

 

Thanks for your help!

 

 

Capture.JPG

1 ACCEPTED SOLUTION

Hi,

 

I created your table ( named it Score) and created 2 measures ( Moy and Final ( for your index) ( sorry for the measure visual), let us know if it helps:

 

Moy = DIVIDE(CALCULATE(SUM(Score[Average]),FILTER(ALLSELECTED(Score),[Average])),COUNTROWS(ALLSELECTED(Score)))

 

The measure for index

 

Final = DIVIDE(SUMX(Score,DIVIDE(Score[Maxnumber],Score[Average])),DIVIDE(MAXX(ALL(Score),[Maxnumber]),[Moy]))

 

Index.PNGThank you.

 

View solution in original post

4 REPLIES 4
heidibb
Helper IV
Helper IV

just bumping this to the top to see if anyone has any thoughts on how to do this.

Thanks!

I think I am very close to figuring this out.

 

Here's what I have done so far, but I have one final question:

 

1. I created a seperate, rolled up data source that has my score and hits already calculated, as well as a "ScoreForIndex" column which divides the number of hits by the score for each row. This data is at the level of Person and Week of Year.

2. I have a calculation in PowerBI for the overall Index as ScoreForIndex/Average(ScoreForIndex)

 

It's working... sort of.

 

It's dividing by the overall average score ignoring any filters that are applied. I am wondering if there is a way to modify the calculation to account for attribute filters, such as week of year.

Hi,

 

I created your table ( named it Score) and created 2 measures ( Moy and Final ( for your index) ( sorry for the measure visual), let us know if it helps:

 

Moy = DIVIDE(CALCULATE(SUM(Score[Average]),FILTER(ALLSELECTED(Score),[Average])),COUNTROWS(ALLSELECTED(Score)))

 

The measure for index

 

Final = DIVIDE(SUMX(Score,DIVIDE(Score[Maxnumber],Score[Average])),DIVIDE(MAXX(ALL(Score),[Maxnumber]),[Moy]))

 

Index.PNGThank you.

 

Hi,

 

I am new on the forum and I will try to help if I really get your point.

I created your table ( I named it Score) with the same data with colum names Average, Maxnumber, HitMax and I created 2 measures ( sorry for the expression visual) and I put them in my power Bi desktop :

Moy = DIVIDE(CALCULATE(SUM(Score[Average]),FILTER(ALLSELECTED(Score),[Average])),COUNTROWS(ALLSELECTED(Score)))

 

Below the index measure you are looking for:

 

Final = DIVIDE(SUMX(Score,DIVIDE(Score[Maxnumber],Score[Average])),DIVIDE(MAXX(ALL(Score),[Maxnumber]),[Moy]))

 

Let us know if you have any observations.

 

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.