I have a report in direct query.
Consider I have 2 tables(table1 and table2) which both have a column that contains stock items. The relation is one to many.
how can I calculate Table1[Qty]*Table2[Price] for each Stock item? (I did it by creating a measure but when I use Card, the filters doesn't apply on it , but in a table, it works perfect)
Go to Solution.
@Matt_Gol , As suggested by @Luuky Try SUMX with related. If there is 1-M relationship between Table 2 to table 1 it should work
if not then you might have do more work
Sumx(Table1, Table1[Qty]*Maxx(filter(Table2, Table[Item] = Table2[Item]) , Table2[Price]))
you can more conditions in second one as per need
View solution in original post
Thank you guys, it works. Much appreciated for your help
Hi @Matt_Gol ,
Try Sumx for it in a measure. If thats not working then I need some visualisation of the tables and how they are related.
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.