cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Switch, value and result from a column

@Lanko 

 

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
🙂

View solution in original post

1 REPLY 1
Highlighted
Community Champion
Community Champion

Re: Switch, value and result from a column

@Lanko 

 

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
🙂

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors