Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
unit | MainCompany | BranchCompany | Column 12 | Column 13... |
1 | 24.50 | 0.00 | ..... | ..... |
0 | 0 | 16.70 | ...... | ..... |
0 | 0 | 8.71 | ...... | ...... |
1 | 17.85 | 0.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
Solved! Go to Solution.
@Anonymous
Give this measure a try.
Card Measure =
VAR _Unit = SELECTEDVALUE ( 'Table'[unit] )
RETURN
SWITCH (
_Unit,
1,SELECTEDVALUE('Table'[MainCompany]),
0,SELECTEDVALUE('Table'[BranchCompany]),
""
)
@Anonymous
Give this measure a try.
Card Measure =
VAR _Unit = SELECTEDVALUE ( 'Table'[unit] )
RETURN
SWITCH (
_Unit,
1,SELECTEDVALUE('Table'[MainCompany]),
0,SELECTEDVALUE('Table'[BranchCompany]),
""
)
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!
Hi jdbuchanan,
Thank you very much for your answer, it woked well.
regards,
Prabath
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
75 | |
56 | |
38 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |