Forum Discussion
TREAT AS DAX Error - Returning back Zero Values
- Anonymous5 years ago
Hi Anonymous
I tried to use DAX Formatter to format your DAX code and understand your logic, but failed...it looks like you have filtered the stand alone table to [Product] = "BB" && [Curve Ref] = "Blah' , but you try to pass the values in fact table [Y-Yield Curve] and [BB]? Where is your SELECTEDVALUE from your slicer?
Maybe it is better to provide some sample data and expected result.
Interset = VAR _Int = SELECTEDVALUE ( input[BB] ) // i have a Slicer from which i select the product... VAR Result = CALCULATE ( AVERAGEX ( 'Y Curves', 'Y Curves'[Y-Percentages] ), 'Y Curves'[Product] = "BB" && 'Y Curves'[Curve Ref] = "Blah", TREATAS ( VALUES ( Input[Y-Yield Curve] ), Input[BB] ), 'Y Curves'[Curves Ref], 'Y Curves'[Product] ) RETURN Result
Hi Anonymous
I tried to use DAX Formatter to format your DAX code and understand your logic, but failed...it looks like you have filtered the stand alone table to [Product] = "BB" && [Curve Ref] = "Blah' , but you try to pass the values in fact table [Y-Yield Curve] and [BB]? Where is your SELECTEDVALUE from your slicer?
Maybe it is better to provide some sample data and expected result.
Interset =
VAR _Int =
SELECTEDVALUE ( input[BB] ) // i have a Slicer from which i select the product...
VAR Result =
CALCULATE (
AVERAGEX ( 'Y Curves', 'Y Curves'[Y-Percentages] ),
'Y Curves'[Product] = "BB"
&& 'Y Curves'[Curve Ref] = "Blah",
TREATAS ( VALUES ( Input[Y-Yield Curve] ), Input[BB] ),
'Y Curves'[Curves Ref],
'Y Curves'[Product]
)
RETURN
Result
- Anonymous5 years agoNot applicable
Vera_33 here is my data model...