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
Vickram
Helper III
Helper III

data from different queries in one visual

Hi,

I have a QueryA which has population data of different age groups based on geographical area which overlaps. So, i will provide the geographical area code to slice the data so that it only shows the population data of that area.

popualtion pct graph and table.png

Now, I have another QueryB which has the popualtion and population percentage data of different age group but for the whole Melbourne area. This data will serve as Melbourne average and should not be affected by geographical area code slicer.

melbourne pop pct.png

Now, I want to add Melbourne Percentage from the QueryB in the first visuals above. But when i do that, the Melbourne percentage is shown as 100% as below.

popualtion pct with melbourne added.png

The common column between QueryA and QueryB is Age Group, but somehow I could not make it work. 

1 ACCEPTED SOLUTION

HI @Vickram,

Your age group is used text values, for the text fields, power bi will use ASCII code order to sorting. (when sorting with ASCII code, the numeric value in text type does not use general number sort orders)

Perhaps you can create a custom sort order table with all age groups and setting index for them.

Custom Sorting in Power BI 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
Vickram
Helper III
Helper III

I thought I solved it by creating a separate query called "Age Group" with unqiue age group values. Then I created a relationship between Age Group Query with QueryA and QueryB. I used the Age Group column from the Query "Age Group" in the visuals instead of age group column frofm QueryA and QueryB. The result is as below:

new result correct.png

Now, the new problem is when I used the custom sorting on the Age Group query, the issues comes back i.e. Melbourne percentage again shown as 100%. Not sure why custom sorting is causing the issue.

HI @Vickram,

Your age group is used text values, for the text fields, power bi will use ASCII code order to sorting. (when sorting with ASCII code, the numeric value in text type does not use general number sort orders)

Perhaps you can create a custom sort order table with all age groups and setting index for them.

Custom Sorting in Power BI 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.