Forum Discussion
Pivot, Dax Formula and Slicer
- May 08, 2023
SELECTEDVALUE() was introduced for the Excel data model recently, I guess it's still on insider channels only.
Alternatively you may use
myMeasuer:= MAXX ( FILTER ( RawP, RawP[Month] = IF ( HASONEVALUE ( RawP[Month] ), VALUES ( RawP[Month] ) ) ), RawP[Ex SS] )
My knowledge of DAX functions is very limited :), to say the least, but at first glance it could be the problem with selectvalue.
If you want your measure to return a result only when a single value is selected in the slicer, then SELECTEDVALUE would be the better choice. However, if you want your measure to return a result based on multiple selected values in the slicer, then ALLSELECTED would be the better choice.
In your original formula, you were using SELECTEDVALUE, which would only return a result if a single month was selected in the Slicer_Month slicer.
If this is the behavior you want, then you should continue to use SELECTEDVALUE.
However, if you want your measure to return a result based on multiple selected months in the slicer, then you should use ALLSELECTED instead.
Here’s an example (with AI helps 🙂 using the ALLSELECTED function with your data in the formula:
=MAXX(FILTER(RawP, RawP[Month] IN ALLSELECTED(Slicer_Month)), RawP[Ex SS])
This formula will return the maximum value of the Ex SS column in the RawP table for all the selected months in the Slicer_Month slicer.
Hope I was able to help you with this info…if not please ignore the message.
I know I don't know anything (Socrates)