Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I've been having some trouble figuring out a proper DAX statement that would return the user selection however based on another column..
So for example I have the following table:
Selection Options | Other Values |
A | 10 |
B | 20 |
C | 30 |
D | 40 |
E | 50 |
The slicer would look at the "Selection Options" column as a mult select.. The user selects "B", "D", and "E" for example..
I want the measure to return something like "Other Values: 20, 40, 50" as the corresponding values to the user selection..
I've figured out using ALLSELECTED and CONCATENAX how to create a concatenated value of the user selection.. however not returning it based on another field.. I suspect it will involved using CALCULATE and FILTER.. however no such luck so far..
Any suggestions are appreciated!
Solved! Go to Solution.
I created an OtherValues as you described and an InverseOtherValues just in case you want that.
OtherValues = VAR __currentTable = ALLSELECTED('Table3') RETURN CONCATENATEX(__currentTable,[Other Values],",")
InverseOtherValues = VAR __allTable = ALL('Table3') VAR __currentTable = ALLSELECTED('Table3') VAR __table = EXCEPT(__allTable,__currentTable) RETURN CONCATENATEX(__table,[Other Values],",")
See page 2, Table 3 of attached.
I created an OtherValues as you described and an InverseOtherValues just in case you want that.
OtherValues = VAR __currentTable = ALLSELECTED('Table3') RETURN CONCATENATEX(__currentTable,[Other Values],",")
InverseOtherValues = VAR __allTable = ALL('Table3') VAR __currentTable = ALLSELECTED('Table3') VAR __table = EXCEPT(__allTable,__currentTable) RETURN CONCATENATEX(__table,[Other Values],",")
See page 2, Table 3 of attached.
If you are feeling especially generous would you know how to tweak your code to return the distinct values only in the concatenation?
My table example has repeating values in the [Other Values] column..
Essentially like this example, however with my caveat of being based on another column being filtered in the selection..
Any insight is appreciated 🙂
I was able to figure this out.. however I'm not sure why this works..
Thanks so much Greg!
What a neat solution!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |