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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Tablular data to calculate quality accuracy

I need a support in both of power query and DAX in the below and highlight to me which scenario is the best to use in terms of performance and simplicity.

I have a tabular data where each index represents transaction evaluation against specific attributes, and I need to calculate quality accuracy per severity as follow

EU = 100%-(count of scores /unique index) considering the below condition:

count of scores per index where severity is EU and incase there is more than score 1 within the same transaction index, it must be counted only one (by other means, if any transaction index with the severity of EU failed (score 1), should reflect only one per this index)

The same goes for BC and CC

 

For NC, it should be calculated on attribute level

NC=100%-(count of score 1 /unique attribute per each index) considering the below condition:

 

count of scores per attribute where severity is NC and incase there is more than score 1 within the same attribute and same index, it should be count only 1 ((by other means, if any transaction index with the severity of EU with the same attribute failed (score 1), should reflect only one per this index)

 

tarekkhalefa_0-1660985316983.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please  try below steps:

1. beow is my test table, according to your descriptions to create

Table:

vbinbinyumsft_0-1662023316537.png

2. create two measure and add it to table visual

EC =
VAR cur_trans =
    SELECTEDVALUE ( 'Table'[Transaction] )
VAR tmp =
    FILTER (
        ALL ( 'Table' ),
        'Table'[Transaction] = cur_trans
            && 'Table'[Score] = 1
            && 'Table'[Severity] = "EU"
    )
VAR tmp1 =
    SUMMARIZE ( tmp, [Transaction], "Avg for Score", AVERAGE ( [Score] ) )
RETURN
    COUNTROWS ( tmp1 )
NC =
VAR cur_trans =
    SELECTEDVALUE ( 'Table'[Transaction] )
VAR tmp =
    FILTER (
        ALL ( 'Table' ),
        'Table'[Transaction] = cur_trans
            && 'Table'[Score] = 1
            && 'Table'[Severity] = "NC"
    )
VAR tmp1 =
    SUMMARIZE (
        tmp,
        [Advisor ID],
        [Attribute],
        "Avg for Score", AVERAGE ( [Score] )
    )
RETURN
    COUNTROWS ( tmp1 )

vbinbinyumsft_1-1662023522442.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
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

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

I want to confirm some information with you.

1. You want to get table 2 from table1, is right?

vbinbinyumsft_0-1661237803679.png

2. could you give me more detailed descriptions about how to calculate for "EC" and "NC"

for below descriptions, i cannot understand the calculate logic absolutely, could you please give me a calculate sample?

vbinbinyumsft_1-1661238014548.png

 

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_ Binbin Yu

Anonymous
Not applicable

@Anonymous  thanks for your support

 

EC calculation = 1-(failed EC / total transactions)  if one attribute failed within the same transaction, it should be considered as only one

NC calculation = 1-( Failed NC / total transactions) 

Anonymous
Not applicable

Hi @Anonymous ,

Please  try below steps:

1. beow is my test table, according to your descriptions to create

Table:

vbinbinyumsft_0-1662023316537.png

2. create two measure and add it to table visual

EC =
VAR cur_trans =
    SELECTEDVALUE ( 'Table'[Transaction] )
VAR tmp =
    FILTER (
        ALL ( 'Table' ),
        'Table'[Transaction] = cur_trans
            && 'Table'[Score] = 1
            && 'Table'[Severity] = "EU"
    )
VAR tmp1 =
    SUMMARIZE ( tmp, [Transaction], "Avg for Score", AVERAGE ( [Score] ) )
RETURN
    COUNTROWS ( tmp1 )
NC =
VAR cur_trans =
    SELECTEDVALUE ( 'Table'[Transaction] )
VAR tmp =
    FILTER (
        ALL ( 'Table' ),
        'Table'[Transaction] = cur_trans
            && 'Table'[Score] = 1
            && 'Table'[Severity] = "NC"
    )
VAR tmp1 =
    SUMMARIZE (
        tmp,
        [Advisor ID],
        [Attribute],
        "Avg for Score", AVERAGE ( [Score] )
    )
RETURN
    COUNTROWS ( tmp1 )

vbinbinyumsft_1-1662023522442.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

can anyone support please

Anonymous
Not applicable

@daXtreme thanks for trying to support me and it's my bad to explain. i tried to make it simple as much as i can.

 

the below is the data that i need to calculate from to produce the 2nd table with a certain condidtions

 

Table Data

tarekkhalefa_0-1661099017641.png

 

 

This is advisor evaluation score card definition

Transaction: transaction number

Advisor ID : advisor ref. number in system

Severity : severity of scored evaluation

Attribute : score evaluation category

Sub=attribute : score evaluation sub-category

Score : 1 means fail, and blank means Pass

 

I just need to extract the below table or to be a measure so i can use it per any dimension (date, agent...)

tarekkhalefa_1-1661099111232.png

 

Conditions

With the below considerations

 

EC : whenever there is failed attribute within the same transaction, it should be calculated as one regarding the number of failed attributes

NC : it is the opposite, it counted based on attributes level so whenever there is failed attributes, it should be counted. But if advisor failed 2 sub-attributes in the same attribute, it should be counted as 1.

 

daXtreme
Solution Sage
Solution Sage

Hi @Anonymous 

 

Great, but could you please give a simplified picture of what you want to do but still representative? It would really be nice if you could trim down the data set to what's essential and show the calculations "in slow motion," so to speak. Then it'll be easier for us to assist you. For the time being, the description is not the easiest to understand.

 

Thanks a lot.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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