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.

0

Graphs: X-axis cannot handle duplicate labels

I'm using the week number for the x-axis in a graph. The sort order is set to an accumulating week number to ensure that data from different years gets separated (although they got the same label).

 

In the screenshots below, I've got data for week 36 through 40 (plus week 44) for both 2016 and 2017.

 

Everything works as intended for as long as the same week number doesn't show up twice in the graph.

 

When the x-axis includes the same week number for both 2016 and 2017, we'll only see the data for the first occurence. For week 36 and 37, we got some categories that are only present in the data for 2017. These are plotted hanging, at the location they should have been plotted if the missing data had been present in the graph.

 

Data shows for week 36 through 40 (plus week 44) since we must use the scroll bar to include these weeks for 2016:

2017-10-13 11_37_19-EmbraceInsightTest - Power BI Desktop.png

Data does not show for categories with duplicate x-axis labels (see the right edge):

2017-10-13 11_38_38-EmbraceInsightTest - Power BI Desktop.png

Status: Delivered
Comments
v-haibl-msft
Employee

@henrikj

 

I'm not very clear about your issue here, could you please provide a simple sample (e.g. a sample table source, or a simple PBIX file)? Please also take a screenshot for the Fields pane to show how you create the chart.

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Needs Info
 
henrikj
Advocate II

@Vicky_Song @v-haibl-msft

 

Sample pbix-file

 

Please see the sample pbix-file for an illustration of the problem. All measures/columns used in the sample visualizations are translated into english. If it's not in english, it's not relevant for the problem. 

 

I don't include a screen shot as it's the sort order that causes the problem. The problem only occurs with the sort order for the week number set to an accumulating week number (i.e. an ever increasing week number). In this case, week 36 in 2016 and week 36 in 2017, are split into two, but they still use the same label for the x-axis.  

v-haibl-msft
Employee

@henrikj

 

I’ve reported it internally to Power BI Team: CRI 50910192
I’ll post here once I get any update about it.

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Accepted
 
v-haibl-msft
Employee

@henrikj

 

I’ve got response from the Product Team.

 

It seems the user has a bug in their model. They are sorting the 'EventWeekNr' column by 'HändelseVeckoNrESTAccum', but there is more than one value in 'HändelseVeckoNrESTAccum' for the same value in 'EventWeekNr'. There needs to be a 1-to-1 relationship between the columns for the sorting to work correctly.

 

If the user removes the Sort by column, it should remove the duplicate labels. If the user wants to show week numbers over multiple years, they will need to do something like add the year to the labels. That way each label is unique. Then the chart will render correctly.

 

Best Regards,
Herbert

henrikj
Advocate II

@v-haibl-msft

 

Thanks for the answer.

 

If this is by design, I should not be able to define that 'EventWeekNr' should be sorted by 'HändelseVeckoNrESTAccum'. This is perfectly doabe in the current version of PBI. 

 

In my case, there is always a unique value in 'HändelseVeckoNrESTAccum' for each value in 'EventWeekNr' that I want to put on the x-axis. There is, as noted by the Product Team, duplicate values for the x-axis (EventWeekNr'). I want these duplicates to show up separately, when sorted by HändelseVeckoNrESTAccum'. If Sort by column should enforce a strict 1-to-1 relationship, my use of Sort by column should not be allowed. 

 

Today, Sort by column only throws an error if there is duplicates the other way around, i.e. there are duplicate values to sort by. In my case, there are duplicate values among the values that I want to be sorted.

 

Thanks,

Henrik

v-haibl-msft
Employee

@henrikj

 

Most likely, when the model was setup, there was a 1:1 relationship between the values in 'EventWeekNr' and 'HändelseVeckoNrESTAccum'. So we let the user save a model that sorted 'EventWeekNr' by 'HändelseVeckoNrESTAccum'. The model probably was refreshed more data, which resulted in duplicate 'EventWeekNr'. However, we don't perform the validation step that would have thrown an error during refreshes. If you remove the sort by on 'EventWeekNr' (set it back to 'EventWeekNr (Default)') and then try to sort it by 'HändelseVeckoNrESTAccum', the user should get an error since they have more than 1 value in 'HändelseVeckoNrESTAccum' for the same value in 'EventWeekNr'.

 

Best Regards,
Herbert

henrikj
Advocate II

@v-haibl-msft

 

You are correct, my bad.

Vicky_Song
Impactful Individual
Status changed to: Delivered