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 Everyone,
Could you please let me know if Field Parameter can be used inside ALLSELECTED/ALL/REMOVEFILTERS Functions.
The idea is to create a dynamic DAX, passing the slected column name from Field parameter to ALLSELECTED.
Example:
RANKX(ALLSELECTED( 'Table'[Column 1] ),[# of Quality Event])
We need to change the Column dynamically based on Field parameter selection. e.g if Column 2 is selected the Rankx will be calculated based on Column 2
Hi @Ang0zyx ,
I created some data:
You can consider creating a table to act as a slicer, whichever is selected, whichever is the Rank
Here are the steps you can follow:
1. Use Enter data to create a table as a slicer.
2. Create measure.
Rank =
var _select=SELECTEDVALUE('Slicer_Table'[Slicer])
return
SWITCH(
TRUE(), MAX('Slicer_Table'[Slicer])="Column1",RANKX(ALLSELECTED('Table'),CALCULATE(MAX('Table'[Column1])),,ASC),
MAX('Slicer_Table'[Slicer])="Column2",RANKX(ALLSELECTED('Table'),CALCULATE(MAX('Table'[Column2])),,ASC))
3. Result:
Slicer select "Column1", sort by [Column1]
Slicer select "Column2", sort by [Column2]
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Yang,
We already have this solution implemented through Field Parameter. So wanted to know confirm if there is any other way to accomodate the Column name (selected in Field parameter) dynamically inside ALLSELECTED so that we dont have to write a SWITCH statement.
Was looking for the same answer. DId you ever find out if there is a way to do this?
Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |