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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
martipe1
Helper I
Helper I

Filter Table Created in Report View

I have a Power Bi report that uses several tables, I might use merge queries to solve my specific problem but don't know if it would be the best for my model as I would be repeating data.

 

I created this table in report view, take note that 3rd column is a SUM from Field C in Table A and the last column is Field A from table B.

 

TableA.FieldATableA.FieldBTableA.SUM(FieldC)TableB.FieldA
12406A1010
12406B2010
12407A1010
12408A5020
12408B2040
12409A3010
12409B1015
12410A2015

 

 

I want to filter the table to show those records where TableA.SUM(Field C) < TableB.FieldA, to show the next table instead:

 

TableA.FieldATableA.FieldBTableA.SUM(FieldC)TableB.FieldA
12408B2040
12409B1015

 

I would appreciate your comments about the best approach.

 

Thanks.

1 ACCEPTED SOLUTION

Hi @martipe1 ,

 

Getting the current row in measure requires wrapping it with an aggregate function. You can refer to below blog for more details:Calculated Columns and Measures in DAX - SQLBI

 

Best Regards,
Adamk Kong

 

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

3 REPLIES 3
v-kongfanf-msft
Community Support
Community Support

Hi @martipe1 ,

 

You can try formula like below, and then use it in "Filters on this visual".

MEASURE =
IF (
    MAX ( 'Table'[TableA.SUM(FieldC)] ) < MAX ( 'Table'[TableB.FieldA] ),
    1,
    0
)

vkongfanfmsft_0-1714527275086.png

 

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much for your answer.

 

I do not understand your formula, would you be so kind to elaborate.

 

1. Why use MAX ?
2.  Don't know how to accomplish this part 

'Table'[TableA.SUM(FieldC)] 

 

Thanks in advance for your help

Hi @martipe1 ,

 

Getting the current row in measure requires wrapping it with an aggregate function. You can refer to below blog for more details:Calculated Columns and Measures in DAX - SQLBI

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.