Forum Discussion
Return a column value on a card, based on a condition
I am creating a tooltip, but I need the same tooltip to return values from different columns
So I need to do something like this:
If table[sports] = "Soccer" returns column table[playersSoccer],
If table[sports] = "Baseball" returns column table[playersBaseball]...
This dax would be on a card, and when the user hovers over it, it will show the value based on the sports table
- Anonymous3 years ago
Hi CastroRibeiro ,
I created some data:
Table:
Columntable:
Here are the steps you can follow:
1. In power query -- Select all – Transform – Unpivot Columns.
2. Create calculated column.
Column = var _len=LEN('columntable'[Attribute]) return RIGHT( 'columntable'[Attribute],_len - 7)3. Join the relationship between two tables.
4. Check out the link below to use Tooltip.
Create report tooltip pages in Power BI - Power BI | Microsoft Learn
5. Result:
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
2 Replies
- Ritaf1983
Super User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - AnonymousNot applicable
Hi CastroRibeiro ,
I created some data:
Table:
Columntable:
Here are the steps you can follow:
1. In power query -- Select all – Transform – Unpivot Columns.
2. Create calculated column.
Column = var _len=LEN('columntable'[Attribute]) return RIGHT( 'columntable'[Attribute],_len - 7)3. Join the relationship between two tables.
4. Check out the link below to use Tooltip.
Create report tooltip pages in Power BI - Power BI | Microsoft Learn
5. Result:
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