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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ChoiJunghoon
Helper III
Helper III

Calculate the value from other tables?

I can't understand DAX..

I want to create the "table" in visualizations by using measure value. 

 

NumberItemCount
0097WN100
   

 

It is direct query. So i can't use the "lookupvalue" function. 

Pbix.file (from onedrive)

could you write the measure without lookupvalue ? 

 

Table A

Number

Item

0097

WN

1303

CO

2955

CO

7496

CO

7820

IC

0308

Fl

5692

CO

6512

MA

8251

Fl

8257

CO

8259

 

  

Table B 

Item

Item_A

AL

AA

AR

AA

CO

CC

Fl

FF

IC

FF

MA

MM

WN

WW

WT

WW

 

Table C 

Number

Item_A

Count

0097

AA

50

0097

WW

100

0308

FF

10

0327

MM

20

0340

MM

30

1303

CC

 

1567

MM

 

1654

WW

1

1658

AA

1

1658

FF

1

2068

WW

 

2141

FF

1

2155

CC

1

2181

WW

1

2184

AA

1

4 REPLIES 4
AllisonKennedy
Super User
Super User

Do you have relationships between these tables?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

thank you for your reply.
Yes, I've done. 

relationship.png

This will be very tricky with many to many relationship. Can you explain what this represents?

For Item_AA = WW for example, which count should go in Item WN and what count should go in Item WT?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thank you.

TableA "Item" has relation with TableB "Item". 
TableB "Item_A" has relation with TableB "Item_A".

-Table A : Direct Query [ I don't use the related , lookupvalue, crossjoing function ] 
-Table B : Import  
-Table C : Direct Query [ I don't use the related , lookupvalue, crossjoing function ] 

So, 
I want to get the table
Create the table in Visulizations.

 

Input values 

Values : 
TableA[Number]
TableB[Item_A]

Measure

 

Measure...... 
Result :      SUM(TableC[Count]) 
Condition :    TableA[Number]+Related(TableB[Item_A]) = TableC[Number]+TableC[Item_A] 


DAX.. 

Measure =
CALCULATE(
      SUM(TableC[Count]),
      TREATAS(
             SELECTCOLUMNS(
                     TableA,
                     "Number",TableA[Number],
                     "Product",RELATED (TableB[ITEM_A])
                      ) 
             TableC[Number],
TableC[ITEAM_A]
)
)

How can i write the DAX by using measure.. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.