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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Looking for help with confusing grouping/ calculation based on 3 columns

HI, 

I am trying to graph an engineer score over time. I'm having a hard time calculating the score.

 

I am unpacking data from a custom built api, and have the following columns:

Engineer | Assigned Date | Weight | Attribute

A                1-2-19                   1              rti

A                  1-5-20                 3              rti

A                  1-6-20                  3             Missed

A                    1-7-20                5            Open

b                  1-6-21                 16             rti

b                   1-6-21                 4              missed

 

 

Every single assignment has it's own row, and there are several thousand.

Every assignemt has an attribute that is either Missed, Open, or RTI (ready to integrate)

There are only ~15 engineers 

I'd like to generate a score for each engineer, consisting of

 

Sum (all weights where attribute = RTI /  Sum(all weights where attribute = missed

So using the above example:

A score = 4/3

B score = 16/4

 

Many weights are 1, so dividing case by case and then summing will not work. 

 

Any ideas on how I can do this?

 

Thanks in advance!

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

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1644390054846.png

When there is no "Missed" in the Attribute of the Engineer, it will not appear first in the visual object by default.

vyangliumsft_1-1644390054851.png

If you want to show it, you can click Show item with no data of [Enginener], but the display is blank.

vyangliumsft_2-1644390054853.png

Result:

vyangliumsft_3-1644390054855.png

If you want to change the blank value to 0, you can use the following dax, add a 0 to the divide, it will automatically convert the blank value to 0:

Measure =
var _rti=CALCULATE(SUM('Table'[Weight]),FILTER(ALL('Table'),'Table'[Engineer]=MAX('Table'[Engineer])&&'Table'[Attribute]="rti"))
var _Missed=CALCULATE(SUM('Table'[Weight]),FILTER(ALL('Table'),'Table'[Engineer]=MAX('Table'[Engineer])&&'Table'[Attribute]="Missed"))
return
DIVIDE(_rti,_Missed,0)

vyangliumsft_4-1644390054858.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

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1644390054846.png

When there is no "Missed" in the Attribute of the Engineer, it will not appear first in the visual object by default.

vyangliumsft_1-1644390054851.png

If you want to show it, you can click Show item with no data of [Enginener], but the display is blank.

vyangliumsft_2-1644390054853.png

Result:

vyangliumsft_3-1644390054855.png

If you want to change the blank value to 0, you can use the following dax, add a 0 to the divide, it will automatically convert the blank value to 0:

Measure =
var _rti=CALCULATE(SUM('Table'[Weight]),FILTER(ALL('Table'),'Table'[Engineer]=MAX('Table'[Engineer])&&'Table'[Attribute]="rti"))
var _Missed=CALCULATE(SUM('Table'[Weight]),FILTER(ALL('Table'),'Table'[Engineer]=MAX('Table'[Engineer])&&'Table'[Attribute]="Missed"))
return
DIVIDE(_rti,_Missed,0)

vyangliumsft_4-1644390054858.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

tackytechtom
Super User
Super User

Hi @Anonymous ,

 

I would have created one measure like this:

 

tommeasure = 
DIVIDE (
    CALCULATE(SUM('Table'[Weight]), 'Table'[Attribute] = "rti"),
    CALCULATE(SUM('Table'[Weight]), 'Table'[Attribute] = "Missed")
)  

 

Does this bring you closer to what you want? 🙂

 

 

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Anonymous
Not applicable

Thanks @tackytechtom 

This results in a meausre which I don't think correlates directly to an engineer, at least that's what I am seeing when I drag it into a visual. 

 

My customer says he is happy with the 3 measure way that it is displayed, but the only thing I have not accounted for is what happens if an engineer has no missed assignments?

Would there be a divide by 0 error, or would the engineer just show a score of 0?

 

Thanks for the help!

Anonymous
Not applicable

Currently I am using 3 measures, but I am not very confident that this is correct, hence the post:

 

RTI = CALCULATE( SUM(RoundRobin[Weight.1]), FILTER(RoundRobin, RoundRobin[Attribute] = "RTI Assignments"))
Missed = CALCULATE( SUM(RoundRobin[Weight.1]), FILTER(RoundRobin, RoundRobin[Attribute] = "Missed Assignments"))
Score = DIVIDE([RTI], [Missed])
I then used engineer as the legend for a bar chart, and added a date slicer to the page.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.