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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
KobeDel
Regular Visitor

Changing hierarchy in visual gives wrong values

Hi all,

 

I have a column visual with a date hierarchy. When going deeper to the week filter instead of year by pushing one of those arrows, it's giving different data.

KobeDel_0-1714983499730.png

 

 

In the first picture, I get the right data. But the weeks are ordered from 1-52. I want them to be ordered first on year and than on week number. But that is giving me an infinity value.

KobeDel_1-1714983575463.pngKobeDel_2-1714983582331.png

 

 

Someone has an idea how to fix this?

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
v-jialongy-msft
Community Support
Community Support

Hi @KobeDel 

 

You can try checking the following points

  1. Verify Hierarchy Setup: Ensure your date hierarchy is correctly set up in the model. Each level of the hierarchy (Year, Month, Week) should be correctly defined. 

  2. Check Data Model Relationships: Ensure that the relationships between the tables (if your date fields are spread across different tables) are correctly established. Incorrect or missing relationships can lead to unexpected results when drilling down. 

 

You want the data to be ordered weeks first by year and then by week number, you might need to create a custom column that combines the year and week number into a single value that can be sorted numerically. Here's a simplified action plan:

  1. Create a Custom Column: In Power BI Desktop, go to the Query Editor, and create a new custom column that concatenates the year and week number into a single value. For example, for year 2021 and week 5, the custom column value could be 202105. This ensures a sortable numeric value representing both the year and the week.

  2. Sort by the Custom Column: Use this custom column as your sorting column in the visual. This approach ensures that your weeks are ordered first by year and then by week number, as intended.

 

 

 

Best Regards,

Jayleny

 

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

3 REPLIES 3
v-jialongy-msft
Community Support
Community Support

Hi @KobeDel 

 

You can try checking the following points

  1. Verify Hierarchy Setup: Ensure your date hierarchy is correctly set up in the model. Each level of the hierarchy (Year, Month, Week) should be correctly defined. 

  2. Check Data Model Relationships: Ensure that the relationships between the tables (if your date fields are spread across different tables) are correctly established. Incorrect or missing relationships can lead to unexpected results when drilling down. 

 

You want the data to be ordered weeks first by year and then by week number, you might need to create a custom column that combines the year and week number into a single value that can be sorted numerically. Here's a simplified action plan:

  1. Create a Custom Column: In Power BI Desktop, go to the Query Editor, and create a new custom column that concatenates the year and week number into a single value. For example, for year 2021 and week 5, the custom column value could be 202105. This ensures a sortable numeric value representing both the year and the week.

  2. Sort by the Custom Column: Use this custom column as your sorting column in the visual. This approach ensures that your weeks are ordered first by year and then by week number, as intended.

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I made also a date hierarchy in the other two tables. This gave me the right data.

Thanks for the help!

KobeDel
Regular Visitor

If needed, I can shire the power BI file

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.