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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pbaumgartner
New Member

Numeric ID as Categorical Variable

I have an variable that's an integer identifier. I want a chart that displays the average of some other variable for each unique option of this ID variable. When I try and do this in Power BI, it just displays the grand mean (or whatever other aggregate calculation) across each unique value, rather than each unique value's aggregation. How do I tell Power BI to treat this numeric ID Variable as a categorical?

 

Screen Shot 2016-12-08 at 4.23.25 PM.png

1 ACCEPTED SOLUTION
bidgeir
Most Valuable Professional
Most Valuable Professional

I might be misunderstanding something here but I have no problems doing this. Both the columns are whole numbers. All I have to do is put on column in Axis and the other in Value and Power BI does the rest. Are you doing something different?

 

2016-12-08_21h57_40.png

View solution in original post

4 REPLIES 4
bidgeir
Most Valuable Professional
Most Valuable Professional

I might be misunderstanding something here but I have no problems doing this. Both the columns are whole numbers. All I have to do is put on column in Axis and the other in Value and Power BI does the rest. Are you doing something different?

 

2016-12-08_21h57_40.png

That's exactly what I'm doing too, I even recreated with some different variables to ensure it wasn't just something weird about that specific combination.

 

If it makes any difference, I'm connected via ODBC to a Postgres database.

Anonymous
Not applicable

This can happen if table relationships are involved and not configured exactly right.  Are there any related tables?  Can you share sample data and/or your .PBIX?

 

...And just saw you got it fixed.  Good news.

Got it figured out, there was some artefact in the data that was causing the calculation execute incorrectly. Thanks for your help.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.