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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Switch, value and result from a column

Hi guys,

 

I created a Report with a measure that returns different strings e.g.

1-2-3            

2-4-1            

I want to add a measure2 to that report that delivers me more information related to that strings. 

Report:

Measure1 | Measure2

1-2-3            | Test123

2-4-1            | Test241

 

The information are written in a table

Table1:

Coordinates |Information

1-2-3            | Test123

2-4-1            | Test241

 

I could do it manually with a Switch like below, but I have more than 64 coordinates with different information. 

measure =
SWITCH(TRUE();
[Cube_coordinate] = "1-2-3"; "Test123";
[Cube_coordinate] = "3-2-1";"Test321"
)

 

How can I combine switch with a table for values and results? 

 

Thanks

BR

Chris

 
1 ACCEPTED SOLUTION
nandukrishnavs
Super User
Super User

@Anonymous 

 

Not sure about your existing data model.

 

Try this 

Measure2 =
VAR m1 = [Measure1]
VAR result =
    CALCULATE (
        SELECTEDVALUE ( 'Table1'[Information] ),
        'Table1'[Coordinates] = m1
    )
RETURN
    result

 

If this is not working then please copy your sample tables and measures here.

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

1 REPLY 1
nandukrishnavs
Super User
Super User

@Anonymous 

 

Not sure about your existing data model.

 

Try this 

Measure2 =
VAR m1 = [Measure1]
VAR result =
    CALCULATE (
        SELECTEDVALUE ( 'Table1'[Information] ),
        'Table1'[Coordinates] = m1
    )
RETURN
    result

 

If this is not working then please copy your sample tables and measures here.

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.