Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello!
I have a table that has data and one column (stock) that I use as a filter. This column only has null, 0 and 1 values. The thing is: I want to use this column in a data segmentation filter (like the one below), and reference whichever value the user chooses to filter in DAX defined columns for this same table, to create dynamic calculations. That is: I want to get the output of that filter and use it in DAX calculations.
The column I want to create would have this syntax:
new_column = CALCULATE( column_1 - column_2, stock = user_defined_stock )
where this variable here, `user_defined_stock`, is the output of the filter above (null, 0 or 1, or multiple selection if that's even possible).
How can I achieve this? I tried using SELECTEDVALUE for that, but I can't figure out how.
Hi @nix_ferreira ,
Any update on this? Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hello @nix_ferreira,
You can create a variable with the name you specified and enclose the the slicer column you are using with the Selectedvalue (VAR)
Please try below.
new_column =
VAR user_defined_stock=SELECTEDVALUE(slicercolumn)
Return
CALCULATE( column_1 - column_2, stock = user_defined_stock )
Please let me know if it solves your requirement. If so, please accept it as a solution, and your kudo is much appreciated.
Hi! That looks like would do the job, but how can I access the output of that data segmentation filter?
Hello @nix_ferreira,
What do you mean access the output of the data segmentation filter?
When you select the value on the slicer, it will automatically be stored as the variable you declared in the measure then it will calculate the value.
Can you please clarify?
Thank you
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 8 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 29 | |
| 21 | |
| 17 | |
| 11 | |
| 10 |