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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
DRossi
Helper III
Helper III

Create a measure that looks for a value in another table

Hello,

 

I have three tables: Date table, Jobs Table and Rebate Table.

 

In my Dates table I have a Year QTR column, of which I have used the same in Rebate Period and there is a relationship (many to many) that is active between Rebate Period in the Rebate Table and Year QTR in the Dates Table.

 

Essentially, I am trying to create a measure that finds the model that was installed (in the jobs table) and from the install date (date), find the Rebate value from the relevant rebate period.

 

I did create a measure but it was summing the models Rebate Value for every Rebate Period when it should only look at the relevant quarter and the corresponding value for that model. Basically, in green is how I need that to llok, either through a measure or new column.

 

 

 

Rebate Value = CALCULATE(SUMX(RebateAmounts,RebateAmounts[Amount]),USERELATIONSHIP(RebateAmounts[Model],LocalHeroes_Warranty[boilerModel]))

 

 

 

 

Example below:

 

Jobs Table

JobIDModelDate*REBATE VALUE*
1GStar 20si01/08/21300
2GStar 25si03/08/21350
3GStar 20si08/08/21300

 

Rebate Table

Model

Rebate PeriodRebate Value
GStar 20si2021 QTR2300

GStar 25si

2021 QTR2350

GStar 30si

2021 QTR2400
GStar 20si2021 QTR3350

GStar 25si

2021 QTR3400

GStar 30si

2021 QTR3450
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DRossi , First Avoid many to many join , between date and table, create a date based on month, qtr or year and use that.

 

First few min this video will give that

https://www.youtube.com/watch?v=yPQ9UV37LOU

 

You can try measure like

Rebate Value = CALCULATE(SUMX(RebateAmounts,RebateAmounts[Amount]),Filter(RebateAmounts , RebateAmounts[Model] in allselected( LocalHeroes_Warranty[boilerModel])))

 

or use treatas

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
DRossi
Helper III
Helper III

Hi @amitchandak  thanks for this.

 

I've added a date in the table and created a Many to One to the dates table.

 

I've added your DAX but now it is summing the whole RebateAmounts Table. It shouldn't sum, it should only display the corresponding rebate value for that model for that quarter.

 

I used LOOKUP

Rebate Value = LOOKUPVALUE(RebateAmounts[Amount],RebateAmounts[Model],LocalHeroes_Warranty[boilerModel])

 

Hmm I might just have it

 

Rebate Value = LOOKUPVALUE(RebateAmounts[Amount],RebateAmounts[Model],LocalHeroes_Warranty[boilerModel])
amitchandak
Super User
Super User

@DRossi , First Avoid many to many join , between date and table, create a date based on month, qtr or year and use that.

 

First few min this video will give that

https://www.youtube.com/watch?v=yPQ9UV37LOU

 

You can try measure like

Rebate Value = CALCULATE(SUMX(RebateAmounts,RebateAmounts[Amount]),Filter(RebateAmounts , RebateAmounts[Model] in allselected( LocalHeroes_Warranty[boilerModel])))

 

or use treatas

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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