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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Solution Sage
Solution Sage

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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