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
PietroFarias
Resolver II
Resolver II

How to include another measure from an unrelated table

I need to adjust the measurement below: TotalValue.

sampleMeasure.png

TotalValue = SUM (Table1 [VALUE])
 
TotalAdjust = SUM (Table1 [VALUE])

 

This file was not modeled correctly. There should be a table with the categories to be able to easily solve the case, and it has already been done.

 

But I would like to know, if I did not create the dCATEGORY table, how would I be able to return the values of the adjustments that originate from Table2 into the TotalValue measure?

6 REPLIES 6
v-shex-msft
Community Support
Community Support

Hi @PietroFarias,

It seems like your relationship is based on date field that can't map two table records correctly. For this scenario, I'd like to suggest you take a look at the following link to create a bridge table to link the table with multiple columns.

Relationship in Power BI with Multiple Columns 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
MarcoPessina
Resolver IV
Resolver IV

Hi,

you can try to use TREATAS function and write this measure:

 

Total value = CALCULATE (
SUM(Table1[Value])+SUM(Table2[Value]),
TREATAS (
VALUES (Table1[Category]),
Table2[Category]
)
)
 
Hope it helps.
Marco
 

I tried other ways that return something like TREATAS and the result was the same. If you notice in the total of TREATAS the value is different because it does not return within the period of the calendar. But return in TOTAL.

 

Screenshot_8.png

@PietroFarias , Prefer to have common Category dimension

new table
Category = distinct(union(all(Table1 [Category]),all(Table1 [Category])))

And you measure shouuld belike this

Final Value =[TotalValue]-[TotalAdjust]

@amitchandak I created the dimensional table to relate both tables.My idea in this post, is more of an educational proposal, to understand how DAX works in a situation like this.

@PietroFarias , Hope you got the answer. Or do you need more input

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.