Forum Discussion
Need help in resolving DAX Query Issues
Hi ranjanrkl127 ,
Remove SELECTED VALUE clause from your DAX. It should work.
IF (
( MAX('Modelling Types'[Modelling Types] )) = "Multiply using Leases Tracking Rate"
|| ( MAX('Modelling Types'[Modelling Types]) ) = "Multiply using Village Tracking Rate",
SUMX (
VAR SummarizedTable =
IF (
MAX('Modelling Types'[Modelling Types]) = "Multiply using Leases Tracking Rate",
SUMMARIZE ( 'Tracked Sales', Dates[Date], Leases[FactLease Key] ),
SUMMARIZE ( 'Tracked Sales', Dates[Date], Villages[Village Key] )
)
RETURN
ADDCOLUMNS (
SummarizedTable,
"Tracking Rate", IF (
MAX('Modelling Types'[Modelling Types]) = "Multiply using Leases Tracking Rate",
CALCULATE (
[% Tracked Sales vs Total Sales],
ALLEXCEPT ( 'Tracked Sales', 'Dates', 'Leases' )
),
CALCULATE (
[% Tracked Sales vs Total Sales],
ALLEXCEPT ( 'Tracked Sales', 'Dates', 'Villages' )
)
),
"selectedmeasure", [TrackedSalesNetBase]
),
VAR MultiplicationFactor =
DIVIDE ( 1, [Tracking Rate] )
RETURN
[selectedmeasure] * MultiplicationFactor
),
[TrackedSalesNetBase]
)
I can't test the DAX at my end as I don't have data. But yes try the above chnaged dax.
Thanks,
Pragati
Sure, i will try now but wanted to check if MAX should really be used with String data? as the column has 3 string data and doing a MAX on it doesn't feel right, any thoughts?
Regards,
Ranjan
- Pragati116 years agoSuper User
Hi ranjanrkl127 ,
Therefore I mentioned that try creating a column rather than a measure, using your original DAX.
Also, try tagging people on your responses, just helps us.
Thanks,
Pragati
- ranjanrkl1276 years agoNew Member
Thanks Pragati11,
I tried with just MAX but same error and I will need this to be a measure as per the requirement, can't create a column.