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 August 31st. Request your voucher.

Reply
yhv
Helper I
Helper I

Creating X-axis calculated column by combining text column and measure

Hi

 

I have to use a column which contains User count and Job Role  as X-Axis in a Bar chart.

 

For Example , If my Job role is Architect and  User count is 5. I have to create a column value as "Architect -5". Also Job Role and User count both are coming from 2 different tables.

 

I tried to create calculated column as [ Role] & "( "&([User Count]) &")" . I am getting User count value as 1 for all roles. However I have user count value more than 1 for all the roles.

 

Could any one please assist me to solve this issue.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @yhv ,

I create two tables as you mentioned.

vyilongmsft_0-1726550919151.png

vyilongmsft_1-1726550949486.png

Then I make a relationship between them.

vyilongmsft_2-1726552215643.png

I also create a calculated column.

Combine = 
VAR UserCountValue =
    RELATED ( UserCounts[UserCount] )
RETURN
    JobRoles[JobRole] & " - " & UserCountValue

vyilongmsft_3-1726552348377.png

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @yhv ,

I create two tables as you mentioned.

vyilongmsft_0-1726550919151.png

vyilongmsft_1-1726550949486.png

Then I make a relationship between them.

vyilongmsft_2-1726552215643.png

I also create a calculated column.

Combine = 
VAR UserCountValue =
    RELATED ( UserCounts[UserCount] )
RETURN
    JobRoles[JobRole] & " - " & UserCountValue

vyilongmsft_3-1726552348377.png

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

shafiz_p
Super User
Super User

Hi @yhv  You are not allowed to use just measure in calculated column. It is against the rule. You need context transition. You need to use calculate function. Wrap you measure with in calculate function. Assuming you have established correct relationship.

 

 

Hope this helps!!

If, Please accept it as a solution!!

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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