Forum Discussion
DAX
Hi,
Please try something like below if it suits your requirement.
Result CC =
SWITCH (
TRUE (),
Tablename[Final] = "Negative", "Negative",
Tablename[Final] = "Positive"
&& Tablename[Type] = "ABCD", FORMAT ( MAX ( Tablename[Numeric_Result] ), "#,#0.00" )
)
- KT92 years agoRegular Visitor
Hi Jihwan_Kim ,
Thank you so much for your response. sorry i didn't communicate well. In Row 2 I am trying to write the code code without MAX function( to return largest no of value). But it is throwing the error ( Function "FORMAT" is not allowed as part of calculated column DAX expressions on DirectQuery models.) Please help.Thank you!
My exactl rule for the calculated column is ( using SQL server as a database)
1. If Final = Negative, then Negative
2. If Final = positive AND type = ABCD, then display the associated value in numeric_result (numeric_result is column name in sqlserver with decimal datatype values like 0.000 , -0.999)
3. IF Final = positive AND type = XYZ, then Positive
4. If Final = In Range, then In Range