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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
Community Champion
Community Champion

@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

Anonymous
Not applicable

@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
Anonymous
Not applicable

@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.
AlB
Community Champion
Community Champion

@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

 

 

AlB
Community Champion
Community Champion

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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