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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
wlf0032
Frequent Visitor

How to Return Values from Matched Attributes using a 3rd Table

Hi,

I have 3 tables with relationships: Index Table (many <--1) Reference Table (1-->many) Benchmark Table.

How can I creat a measure in Index Table that, for each given Index, returns the corresponding value from the Benchmark table (for any given date)?

e.g. for date 2022-01-02, Index1, new measure should = 2.8.

 

Thank you very much!

 

Index Table

Date  Index  IndexValue 
2022-01-01  Index1

  2

2022-01-01  Index2  3
2022-01-02  Index1  2.5
2022-01-02  Index2  3.5

 

Benchmark Table

Date  Benchmark    BMValue 
2022-01-01  BM1

  2.2

2022-01-01  BM2  4
2022-01-02  BM1  2.8
2022-01-02  BM2  4

 

Reference Table

Index  Benchmark
Index1  BM1
Index2  BM2

 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Simplest application of expanded table,

CNENFRNL_0-1648672596819.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

Simplest application of expanded table,

CNENFRNL_0-1648672596819.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Thank you! Your messure works well if I just want to retrieve the corresponding BM value.

 

But I don't quite understand the logic of using "INDEX" table as a filter in CALCULATE. I tried to apply your template for another measure, which will get the cumulative product of the correspoding BM for the last 7 days, it failed to give the correct result. i.e. I tried:

 

CumulativeBM = CALCULATE(

                                  PRODUCT(BENCHMARK[BMValue]),

                                  INDEX,

                                  DATESINPERIOD(BENCHMARK[Date],MAX(INDEX[Date]),-7,DAYS))

 

How should I modify the formula here? Thank you!

CNENFRNL
Community Champion
Community Champion

As mentioned, it involves expanded table, a profound understanding of filter propagation in DAX. Here's a instructive post on this subject,

Expanded tables in DAX - SQLBI

 

This one works equally,

CNENFRNL_0-1648683098497.png

 

Your measure looks alright to me. Check relationships among tables in your data model. They're of extremely high importance.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.