Forum Discussion
Help with dax formula
Thank you for your response.
No, it's not solved by removing the ALL. If I take it off, it has exactly the same behavior.
I don't think I'm doing that SELECTEDVALUE formula thing right. In the same .pbix I have another similar problem.
I have a "Has One Filter? • ISCROSSFILTERED('AFO Global Report'[Project Code])" so that if I segment by "Project Code" I will return data in some visuals.
If I select a project,
But if I select two, it leaves those objects blank.
The formula for Event Description is: IF([Has One Filter?],SELECTEDVALUE('AFO Global Report'[Last Quality Event Description],BLANK()))
And for Event Date: IF([Has One Filter?],SELECTEDVALUE('AFO Global Report'[Last Quality Event Date]),BLANK())
Always using my measure "Has One Filter?" (which is actually a CROSS), to make if I select one or two in slicer I will return data, and if I don't leave it blank.
Let's see if you can help me!
Hi Syndicate_Admin,
Oh, I got it! I got the wrong direction before.😝
Please refer the definition of the functions:
https://docs.microsoft.com/en-us/dax/hasonefilter-function-dax
Returns TRUE when the number of directly filtered values on columnName is one; otherwise returns FALSE.
If you choose two slicer options, it will return Blank().
For your first issue:
Please refer:
https://docs.microsoft.com/en-us/dax/selectedvalue-function
Returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.
So, what is your expected output for the measure?
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.