Forum Discussion
DAX measures , same logic , different results
Hello community,
I created the Diff-1_Pallets and Diff-2_Pallets measures , in order to calculate the differences between the latest extraction set vs the previous one, and between the latest extraction set vs the oldest one , respectively.
The Shipments[Index] column shows the extraction dates' ranking, 1 being the latest extraction and 3 the oldest one.
Kind regards,
George
- Anonymous4 years ago
HI Anonymous.
Any update for these? Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
7 Replies
- AnonymousNot applicable
Hi Anonymous,
Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to troubleshoot.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
Hello Anonymous
Thank you for your reply.
Below you can find a shorter version of the Shipments table and a screenshot of my data model.
The screenshot found at my initial message shows the results filtered to the status RU.
IndexExtraction DateStatusShipment dateSum of Pallet_Num
1 15/11/2021 RU 04/11/2021 6 1 15/11/2021 RU 03/01/2022 4 1 15/11/2021 RU 17/01/2022 4 1 15/11/2021 RU 25/04/2022 4 2 02/11/2021 RU 05/11/2021 6 2 02/11/2021 RU 10/01/2022 4 2 02/11/2021 RU 31/01/2022 4 3 26/10/2021 RU 02/11/2021 6 3 26/10/2021 RU 10/01/2022 4 3 26/10/2021 RU 31/01/2022 4 Hope this helps.
George
- m3tr01dContinued Contributor
Anonymous
The only difference is with the field PreviousDataSet and OldestDataset.
I would build two tables using Week + PreviousDataset and Week + OldestDataset. Then, you can compare where the difference is.
When you filter the Week from the Date table, it will filter the Shipment table. So maybe, when the rows are filtered, sometimes, you will have 3 dates with 3 index so in this case MAX( Index) and Current+1 won't return the same value.
If Current is 1 then MAX( Index) will return 3 and the other one 2.- AnonymousNot applicable
thank you m3tr01d and apologies for my late reply, will do that and get back to you
- AnonymousNot applicable
HI Anonymous,
If these expressions get the same result when you use static values and get different results when you add aggregate functions to let them dynamically based on current row contents.
For this scenario, it means these functions are working on the different row context levels so that the min/max function got the different results and they affect expressions calculations.Please take a look at the following blog about row and filter context if help:
Row Context and Filter Context in DAX - SQLBI
Regards,Xiaoxin Sheng
- AnonymousNot applicable
thank you Xiaoxin , will have a look at the link for sure
- AnonymousNot applicable
HI Anonymous.
Any update for these? Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng