Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to show a value in a table column on a card visual, base on another column value

Hi All,

I am new to Power BI and appreciate if someone can help to reolve the below pls?

I have a table in the Data model as below

unitMainCompanyBranchCompanyColumn 12Column 13...
124.500.00..........
0016.70...........
008.71............
117.850.00...........
........................

 

I have above table on PowerBI desktop data model and there is a slicer set, which select a single row at a time.

"Unit" column is set as integer and which has values of either 1 or 0

"MainCompany" and "BranchCompany" are set as 'Text' type in the backend table, and no calculation is required what I want to just show the values in the columns:

>>>>>>>>>>>>

I want to have a 'Card' on visualisation, based on following criteria:

If unit = 1, then select "MainCompany" value

                  Else  select "BranchCompany" value

 

>>>>>>>>>>

Appreciate your advice pls?

Thanks.

Prabath

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

Give this measure a try.

Card Measure = 
VAR _Unit = SELECTEDVALUE ( 'Table'[unit] )
RETURN
SWITCH (
    _Unit,
    1,SELECTEDVALUE('Table'[MainCompany]),
    0,SELECTEDVALUE('Table'[BranchCompany]),
    ""
)

jdbuchanan71_0-1656857956708.png

 

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

@Anonymous 

Give this measure a try.

Card Measure = 
VAR _Unit = SELECTEDVALUE ( 'Table'[unit] )
RETURN
SWITCH (
    _Unit,
    1,SELECTEDVALUE('Table'[MainCompany]),
    0,SELECTEDVALUE('Table'[BranchCompany]),
    ""
)

jdbuchanan71_0-1656857956708.png

 

Hi and good morning jdbuchanan71, what about if i want to do it based on the column? which is if i click MainCompany it will display the value. and if click branchcompany, it will display other value. Thank you!

Anonymous
Not applicable

Hi jdbuchanan,

Thank you very much for your answer, it woked well.

regards,

Prabath

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.