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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
HankScorpio2
Helper I
Helper I

Sum and filter a table based on a condition in another table

hi 

 

I am trying to create a total possible score for each evaluation. The total can be different for each evaluation due to N/a marking for some criteria.

 

I have this example data from my report. 

The first table is so evaluation results named QualityData and the second table is the max possible score for each section named MarkReference.. 

 

 

 

Evaluation Date
 (dd/mm/yyyy)
Agent2.12.22.33.13.23.34.14.25.15.25.35.45.56.16.26.36.47.17.27.3
15/01/2025 0:00Same Person353107357510101073333444
16/01/2025 0:00Same Person350107350 101010733304 4
17/01/2025 0:00Same Person3031003570101010730334 4

 

SectionMark

2.13
2.25
2.33
3.110
3.27
3.33
4.15
4.27
5.15
5.210
5.310
5.410
5.57
6.13
6.23
6.33
6.43
7.14
7.24
7.34

 

What I am trying to do is sum the sections in MarkReference table for each evaluation  filtering out the sections that are blank in the QualityData table. So that for this person I should end up with a result set like this. 

 ResultPossible score
 109109
 87100
 85105
Totals281314

 

This is the formula I am using 

 

 

Possible Score = CALCULATE(SUMX(MarkReference,MarkReference[Mark]),FILTER(QualityData, QualityData[Value] <> BLANK()))

 

and tried this version also without success. It keeps summing up the filter not the table sumx is on.

Max Score = CALCULATE(SUMX(RELATEDTABLE(MarkReference), [Mark]), FILTER(QualityData, QualityData[Value] <> BLANK()))

 

It doesn't sum MarkReference however, it sums the filter value and I am returned the Result values instead of the Possible Score values as in the table above. 

 

How can I acheive this?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi

 

Please follow below steps to achieve expected results.

 

Step 1 :- 

Unpivot section columns from QualityData Table using Power Query. so, that you will get all sections in one column.

 

Step 2:-

Then create relationship between both table using Section Column. one to Many Relationship

 

Step3 :-

You will get correct results for Actual Score without any context modification

 

Step 4:

For getting Possible Score, Use below formula.

Possible Score =
        CALCULATE(
                    SUM(MarkReference[Marks]),
                    CROSSFILTER(MarkReference[Section],QualityTable[Section],Both)
        )
 
Pangane_0-1737024680036.png

 

 
Please accept solution, if it resolve your issue.
 
Thanks & Regards
Pravin Angane

 

 

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @HankScorpio2,

Any update on this? Did these suggestions suitable with your requirement?

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @HankScorpio2 ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi

 

Please follow below steps to achieve expected results.

 

Step 1 :- 

Unpivot section columns from QualityData Table using Power Query. so, that you will get all sections in one column.

 

Step 2:-

Then create relationship between both table using Section Column. one to Many Relationship

 

Step3 :-

You will get correct results for Actual Score without any context modification

 

Step 4:

For getting Possible Score, Use below formula.

Possible Score =
        CALCULATE(
                    SUM(MarkReference[Marks]),
                    CROSSFILTER(MarkReference[Section],QualityTable[Section],Both)
        )
 
Pangane_0-1737024680036.png

 

 
Please accept solution, if it resolve your issue.
 
Thanks & Regards
Pravin Angane

 

 

 

 

saud968
Super User
Super User

1. Data Preparation

Ensure Consistent Data Types: Make sure the Value column in QualityData and the Mark column in MarkReference are of the same data type (e.g., both numbers).
Clear Relationships: Define a clear relationship between the two tables. This relationship should be based on the Section column (assuming you have a Section column in both tables to link them).
2. DAX Formula

Possible Score =
CALCULATE(
SUM(MarkReference[Mark]),
FILTER(
MarkReference,
RELATED(QualityData[Value]) <> BLANK()
)
)

Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors