Forum Discussion
Dax formula result blank
- Anonymous2 years ago
Hi Aidadiawndao ,
Does the filter context for Plant_ID_Period_Key[Date] contain multiple values? If so, the SELECTEDVALUE ( Plant_ID_Period_Key[Date] ) part returns null, which could be a reason.
Please try:_TotalOrdered_Executed_PID_SelectedPeriod_Test = CALCULATE ( [_Sum Total Ordered Value], FILTER ( ALL ( Plant_ID_Period_Key ), Plant_ID_Period_Key[Date] IN ALLSELECTED ( Plant_ID_Period_Key[Date] ) && [_Calculated_RPEXEC] = "Executed at PID Level" ) )Or
_TotalOrdered_Executed_PID_SelectedPeriod_Test = CALCULATE ( [_Sum Total Ordered Value], FILTER ( ALL ( Plant_ID_Period_Key ), Plant_ID_Period_Key[Date] >= MIN ( Plant_ID_Period_Key[Date] ) && Plant_ID_Period_Key[Date] <= MAX ( Plant_ID_Period_Key[Date] ) && [_Calculated_RPEXEC] = "Executed at PID Level" ) )Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi Aidadiawndao ,
Does the filter context for Plant_ID_Period_Key[Date] contain multiple values? If so, the SELECTEDVALUE ( Plant_ID_Period_Key[Date] ) part returns null, which could be a reason.
Please try:
_TotalOrdered_Executed_PID_SelectedPeriod_Test =
CALCULATE (
[_Sum Total Ordered Value],
FILTER (
ALL ( Plant_ID_Period_Key ),
Plant_ID_Period_Key[Date]
IN ALLSELECTED ( Plant_ID_Period_Key[Date] )
&& [_Calculated_RPEXEC] = "Executed at PID Level"
)
)
Or
_TotalOrdered_Executed_PID_SelectedPeriod_Test =
CALCULATE (
[_Sum Total Ordered Value],
FILTER (
ALL ( Plant_ID_Period_Key ),
Plant_ID_Period_Key[Date] >= MIN ( Plant_ID_Period_Key[Date] )
&& Plant_ID_Period_Key[Date] <= MAX ( Plant_ID_Period_Key[Date] )
&& [_Calculated_RPEXEC] = "Executed at PID Level"
)
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
sorry,
After checking, it gives me total of all orders without taking into account the date filters, So when I filter 1 PID, the sum is the same as if I select all PIDS
- Anonymous2 years agoNot applicable
Hi Aidadiawndao ,
In your previous code all filters from the 'Plant_ID_Period_Key' table were ignored, is this part necessary?
Please try:_TotalOrdered_Executed_PID_SelectedPeriod_Test = CALCULATE ( [_Sum Total Ordered Value], Plant_ID_Period_Key[Date] IN ALLSELECTED ( Plant_ID_Period_Key[Date] ) && [_Calculated_RPEXEC] = "Executed at PID Level" )Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group