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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
yhv
Frequent Visitor

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
v-yilong-msft
Community Support
Community Support

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
v-yilong-msft
Community Support
Community Support

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
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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