cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vogels
Frequent Visitor

Get a text output from a row context measure

Hi PBI-forum users,

 

I'm trying to get a text output in a measure based on an IF-statement. 

I know it's possible to just add an column with an if-statement like if(table[column] < 10; "Category 1"; "Category 2").

However i'm using what-if parameters in my report and they are only useable with measures and not columns. 

I know I can use sumx(table, if(table[column] < 10; 1; 0).

 

However, I need the row context in order to give me a text output like:

sumx(table, if(table[column] < 10; "Category 1"; "Category 2") (this measure obviously does not work with sumx, but I hope you understand what I'm trying to do...

 

I can't think of any function on how to achieve this, does anyone on here?

 

Thanks in Advance!

2 ACCEPTED SOLUTIONS
AlB
Super User III
Super User III

@Vogels 

I'm not sure I understand but this  

 

New Col = if(table1[column] < 10, "Category 1", "Category 2")

 

 you can implement with a measure like

 

Measure = if (DISTINCT(table1[column]), < 10, "Category 1", "Category 2"))

 

or

 

Measure = if (SUM(table1[column]), < 10, "Category 1", "Category 2"))

 

and then the exact equivalent:

 

New Col  = [Measure]

 

context transition will help you behind the scenes

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

 

View solution in original post

V-pazhen-msft
Community Support
Community Support

@Vogels 
I am not quite sure, but to get the what you are expected with the

column = if(table[column] < 10; "Category 1"; "Category 2"), 

 

you can create the following measure:

Measure = if(SUM([Column])<10, "Category 1", "Category 2")
 
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@Vogels 
I am not quite sure, but to get the what you are expected with the

column = if(table[column] < 10; "Category 1"; "Category 2"), 

 

you can create the following measure:

Measure = if(SUM([Column])<10, "Category 1", "Category 2")
 
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

AlB
Super User III
Super User III

@Vogels 

I'm not sure I understand but this  

 

New Col = if(table1[column] < 10, "Category 1", "Category 2")

 

 you can implement with a measure like

 

Measure = if (DISTINCT(table1[column]), < 10, "Category 1", "Category 2"))

 

or

 

Measure = if (SUM(table1[column]), < 10, "Category 1", "Category 2"))

 

and then the exact equivalent:

 

New Col  = [Measure]

 

context transition will help you behind the scenes

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

 

View solution in original post

AlB
Super User III
Super User III

Hi @Vogels 

Ok, but what operation are you trying to do with that text, if it's not the addition that SUMX provides and that is not valid in this case? Maybe CONCATENATEX( )? If not, what?

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Vogels
Frequent Visitor

I need to get an text-output in the row context, so each row is categorized. However this needs to work with my whatif parameters, because my visuals need to adjust on this. 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors