Forum Discussion
dax expression help needed
- Anonymous1 year ago
Hi ashmitp869 ,
Please try below DAX measure:
Forecast_to_complete_test_1 =
VAR ForecastMethod_CurrentRow =
SELECTEDVALUE(CurrentProjectForecastDetail[Forecast_Method], "None")
VAR RowValue =
IF(
ForecastMethod_CurrentRow = "None",
0,
[Remaining Qty] * [CE Rate]
)
RETURNIF(
ISINSCOPE(CostItem[Cost_item_id]),
RowValue,
SUMX(
FILTER(
CostItem,
CostItem[Is_terminal] = TRUE()
&& RELATED(CurrentProjectForecastDetail[Forecast_Method]) <> "None"
),
[Remaining Qty] * [CE Rate]
)
)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
B Manikanteswara Reddy
Hi,
Share the download link of the PBI file. Explain the problem in simple English. Show the expected result clearly.
Hi Ashish_Mathur
Sample file provided.
https://github.com/suvechha/samplepbi/blob/main/sample%20(2)%20-%20Copy.pbix
Expected result
When Forecast method is None show 0.
And
total Sum should be 1,316,029 instead of 1,951,120
Thanks
- Ashish_Mathur1 year agoSuper User
Hi,
Used these measures
Measure 2 = [Remaining Qty] * [CE Rate]Measure 4 = MAX(CurrentProjectForecastDetail[Forecast_method])Measure 3 = SUMX(FILTER(VALUES(CostItem[CBS Level 4]),[Measure 4]<>"None"),[Measure 2])Hope this helps.