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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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