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.
Hello All!
I'm working on a problem that seems pretty simple, but for some reason I'm not seeing the solution. I have a table that contains the customer name & rank.
client | Rank |
1 | |
Microsoft | 2 |
Apple | 3 |
Amazon | 4 |
In the PBIX file, I can add cards displaying customer names & use the filter pane to specify which customer to display by the rank value.
I'm trying to figure out how to get the same functionality by using a measure instead of the filter pane. In other words, how can I set the card up to display the client name based on the rank specified in the measure. My thought is something like this but I know it won't work:
FILTER(
VALUES(Sheet1[client]),
Sheet1[Rank] = 4
)
link to pbix file on google drive
link to underlying data on google drive
Thanks for your time!
Solved! Go to Solution.
@ccapowerbi
There are several options, using the filter:
Measure =
MAXX(
FILTER(
Sheet1,
Sheet1[Rank]= 4
),
Sheet1[client]
)
using Lookupvalue
Measure 2 =
LOOKUPVALUE(Sheet1[client],Sheet1[Rank],4)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click the Thumbs-Up icon if you like this answer 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Anonymous ,
According to my understanding, you want to use Card visual to display Client based the selected rank , right?
I did it in two ways.
1. Use slicer
// Create a new table for slicer
forSlicer =
ALLSELECTED ( CustomRank[Rank] )
slicerMeaure =
VAR _sele =
SELECTEDVALUE ( forSlicer[Rank] )
RETURN
CALCULATE (
SELECTEDVALUE ( 'CustomRank'[Client] ),
FILTER ( CustomRank, CustomRank[Rank] = _sele )
)
2.Use What-if parameter
//Create a What-if parameter:
Parameter =
GENERATESERIES ( MIN ( CustomRank[Rank] ), MAX ( CustomRank[Rank] ), 1 )
parameterMeaure =
VAR _sele =
SELECTEDVALUE ( Parameter[Parameter] )
RETURN
CALCULATE (
SELECTEDVALUE ( 'CustomRank'[Client] ),
FILTER ( CustomRank, CustomRank[Rank] = _sele )
)
'
Is the result what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
@Anonymous , You can have hardcoded filter like
maxx(filter(VALUES(Sheet1[client]), Sheet1[Rank] = 4),sheet[client])
or create a what if parameter and use that
maxx(filter(VALUES(Sheet1[client]), Sheet1[Rank] = selectedvalue(parameter[parameter])),sheet[client])
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/
@ccapowerbi
There are several options, using the filter:
Measure =
MAXX(
FILTER(
Sheet1,
Sheet1[Rank]= 4
),
Sheet1[client]
)
using Lookupvalue
Measure 2 =
LOOKUPVALUE(Sheet1[client],Sheet1[Rank],4)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click the Thumbs-Up icon if you like this answer 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
115 | |
100 | |
90 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |