Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi
I am new to power bi and I have an issue with a dax query.
I have a table containing names of products.
I have created a slicer of the products column
I have created a dax query - IF(VALUES('table'[products] = SELECTEDVALUE('table'[products], 1, 0)
I would like to return 1 if for the selected product in slicer and for other products 0
The matrix table is as below:
Product measure
A 1
B 0
C 0
When applied, I get error msg saying multiple values supplied.
Pls help.
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
One of ways to create a visualization as you needed is to have disconnected slicer table like below.
Desired outcome measure: =
IF (
HASONEVALUE ( 'Product'[Product] ),
INT (
SELECTEDVALUE ( 'Product'[Product] ) IN VALUES ( 'Slicer table'[Product] )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank u sir. It works !!!
In continuation to that, suppose if I want to get a value, say, a column in the product table containing sale amount instead of 1 or 0.....how to achieve this? Would appreciate very much for your help. Thanks
Hi,
Thank you for your feedback.
Please share your sample pbix file's link here, and then I can try to look into it to come with a more accurate solution.
Thank you.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please check the below picture and the attached pbix file.
One of ways to create a visualization as you needed is to have disconnected slicer table like below.
Desired outcome measure: =
IF (
HASONEVALUE ( 'Product'[Product] ),
INT (
SELECTEDVALUE ( 'Product'[Product] ) IN VALUES ( 'Slicer table'[Product] )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
38 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |