Forum Discussion
wrong returned data when combining tables in a measure
- Anonymous2 years ago
Hi,bvdm1980
Here are our solutions based on our understanding of your needs:
1.First I have created the following table and the column names and data are the data you have given:2.I created the following table link:
3. Below are the measure I've created for your needs:
urchase order result = CALCULATE( SUM(budget[Budget amount])-SUM('detail'[Purchase order line amount]) - MAX('detail'[Risk reservation]), FILTER('order', 'order'[stauts] = "approved"))4.Here's my final result, which I hope meets your requirements.
5.If the above options don't work, you can use the Allselected() function or the All() function in the FILTER() function:
FILTER(ALLSELECTED('order'), 'order'[stauts] = "approved"))FILTER(ALL ('order'), 'order'[stauts] = "approved"))The following is the relevant documentation:
ALLSELECTED function (DAX) - DAX | Microsoft Learn
ALL function (DAX) - DAX | Microsoft Learn
Or check if your table relationships are affecting your results, and the meassure you are quoting.Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,bvdm1980
Here are our solutions based on our understanding of your needs:
1.First I have created the following table and the column names and data are the data you have given:
2.I created the following table link:
3. Below are the measure I've created for your needs:
urchase order result =
CALCULATE(
SUM(budget[Budget amount])-SUM('detail'[Purchase order line amount]) - MAX('detail'[Risk reservation]),
FILTER('order', 'order'[stauts] = "approved"))
4.Here's my final result, which I hope meets your requirements.
5.If the above options don't work, you can use the Allselected() function or the All() function in the FILTER() function:
FILTER(ALLSELECTED('order'), 'order'[stauts] = "approved"))FILTER(ALL ('order'), 'order'[stauts] = "approved"))
The following is the relevant documentation:
ALLSELECTED function (DAX) - DAX | Microsoft Learn
ALL function (DAX) - DAX | Microsoft Learn
Or check if your table relationships are affecting your results, and the meassure you are quoting.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.