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.
I hope the file can be opened from the above link.
Hi. I would like to have an empty measure until a name is selected in the matrx. The measure is [Order #]. Once a customer name is selected in the matrix, I want the card to show that customer's order #. If no selection is made, show blank card. How can this be achieved?
Thanks, FB
Solved! Go to Solution.
Sorry, I must've been drunk. I meant MIN or MAX, should make no difference
VAR _SlicerSelection = SELECTEDVALUE('Table'[Customer])
RETURN
IF (_SlicerSelection = BLANK(), "", MIN('Table'[Order #]))
So, the Variable will return either (BLANK) or a customer. If it returns "(BLANK)", your first trigger condition is met, and it returns the text between the apostrophes (which is nothing), therefore showing empty. If it returns a Customer, because you have one selected in your slicer, then it will return the minimum value in the column [Order #]. I understood your model to be that you only had one [Order #] per [Customer].
Hi @FOXYBARK ,
I don't have access to your sample file from your sharing link. According to your statement, I think you want your measure [Order #] be empty until you select a [Customer Name]. Here I suggest you to use [Customer Name] from another unrelated table. If you use [Customer Name] whose data is from the same table as the data in [Order #] measure, ISFILTERED Function will not work.
My Sample:
Customer Name = VALUES('Table'[Customer Name])
Measure:
Measure =
IF(
ISFILTERED('Customer Name'[Customer Name]),
CALCULATE(MAX('Table'[Order]),FILTER('Table','Table'[Customer Name] in VALUES('Customer Name'[Customer Name]))),
BLANK())
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you. In your measure, it is assumed that the table that has the Order # also has the Customer Name. In my data, that is not the case. My table only has an occupant_id, Order #. I tried your meaure swapping out the 'table'[customer name] for 'table'[occupant id]. It didn't work. So frustrating.
Sorry, I must've been drunk. I meant MIN or MAX, should make no difference
VAR _SlicerSelection = SELECTEDVALUE('Table'[Customer])
RETURN
IF (_SlicerSelection = BLANK(), "", MIN('Table'[Order #]))
So, the Variable will return either (BLANK) or a customer. If it returns "(BLANK)", your first trigger condition is met, and it returns the text between the apostrophes (which is nothing), therefore showing empty. If it returns a Customer, because you have one selected in your slicer, then it will return the minimum value in the column [Order #]. I understood your model to be that you only had one [Order #] per [Customer].
This was my winning measure. I have 2 different tables. One with the name and one with the order #.
Thanks. Let me try that.
How about:
VAR _SlicerSelection = SELECTEDVALUE('Table'[Customer])
RETURN
IF (_SlicerSelection = BLANK, "", FIRST('Table'[Order #]))
Will this work if I have my customer name in one table and order # in another table? The slicer will still be the customer name.
Yes, as I think it should, as long as you have a relationship configured between the 2 different tables.
When you select a value in the slicer for Customer, the table that contains customer (let's call it customer table) is filtered in the background to contain ONLY the values in your selection. It will also filter any tables that are in a relationship with the customer table.
Hi.
This doesn't seem to work as I don't have the 'FIRST' keyword available.
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 |
---|---|
98 | |
97 | |
75 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |