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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DanielW
New Member

Chart analytics preventing chart display when used with SWITCH command

Hi

 

I have an established report with a line viz that uses a switched KPI with percentile analytics across a time range. Since last week, the analytics have started breaking the viz with this error displayed to the user:

 

"Error fetching data for this visual

Couldn't retrieve the data for this visual. Please try again later."

 

And this in the desktop app:

 

"ProjectionReferencedIndices does not contain DataShapeBindingAggregate.Select"

 

When I remove the analytics, the chart displays fine. If I don't use a KPI with the SWITCH command I don't get the same problem, even where the switch selection refers to the same KPI. Nothing has changed in the report between it working and not working.

 

Has something changed in the software relating to the interaction between SWITCH and chart analytics in the last few days that would affect this? Any idea how to fix it without removing the percentiles or the SWITCH command?

 

I have tried reloading the data, but to no avail.

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@DanielW .I am glad to help you.

I actually managed to have a problem similar to yours later on by using Power BI Desktop (August version):

like this:

vjtianmsft_0-1725426527252.png

Problem reproduction process:
When I set up conditional formatting for a chart and then reset Analytics I get the same error.

vjtianmsft_1-1725426570378.png

Oddly enough, this problem occurs sometimes (it occurs when setting the conditional format first and then setting Analytics, causing the visual to not display)
After removing the Y-axis data/Analytics or so, the vsiual is back to normal!
and again the issue does not occur when setting Analytics first and then placing the Y-axis data.
I have discussed this phenomenon with the rest of the team and indicated that other users have recently experienced similar issues when using conditional formatting or placing Measure.
I would suggest that you can circumvent the Analytics related issues by first downloading the historical version of power BI desktop. (Suggest downloading the June version, which I have tested without similar issues)
No problems with the June version:

vjtianmsft_2-1725426614067.png

URL:
Previous monthly updates to Power BI Desktop and the Power BI service - Power BI | Microsoft Learn

We have now confirmed that the latest version of Desktop (August Version) currently has a problem with the Analytic line.

We have seen on the internal platform that other engineers have reported this issue and submitted it.
 The engineers on the product team are now aware and will do their best to resolve the issue. I will update here if there is any progress, so please be patient.

 I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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

2 REPLIES 2
Anonymous
Not applicable

Hi,@DanielW .I am glad to help you.

I actually managed to have a problem similar to yours later on by using Power BI Desktop (August version):

like this:

vjtianmsft_0-1725426527252.png

Problem reproduction process:
When I set up conditional formatting for a chart and then reset Analytics I get the same error.

vjtianmsft_1-1725426570378.png

Oddly enough, this problem occurs sometimes (it occurs when setting the conditional format first and then setting Analytics, causing the visual to not display)
After removing the Y-axis data/Analytics or so, the vsiual is back to normal!
and again the issue does not occur when setting Analytics first and then placing the Y-axis data.
I have discussed this phenomenon with the rest of the team and indicated that other users have recently experienced similar issues when using conditional formatting or placing Measure.
I would suggest that you can circumvent the Analytics related issues by first downloading the historical version of power BI desktop. (Suggest downloading the June version, which I have tested without similar issues)
No problems with the June version:

vjtianmsft_2-1725426614067.png

URL:
Previous monthly updates to Power BI Desktop and the Power BI service - Power BI | Microsoft Learn

We have now confirmed that the latest version of Desktop (August Version) currently has a problem with the Analytic line.

We have seen on the internal platform that other engineers have reported this issue and submitted it.
 The engineers on the product team are now aware and will do their best to resolve the issue. I will update here if there is any progress, so please be patient.

 I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,@DanielW .I am glad to help you.
It looks like you are experiencing a problem using the percentile line in the analyze function: (it can't be used with the switch function or the visual won't display properly)
1. you mentioned that it was working fine before, only this time it was having problems. And I don't think it should be a problem with the data source/data connection mode (Direct Query connection mode doesn't support Percentlie line)
URL:
Use the Analytics pane in Power BI Desktop - Power BI | Microsoft Learn

2. You suspect that there is a conflict between the switch function and the Percentlie line, which I have tested below:
import connection mode: normal execution

vjtianmsft_0-1725417923532.png
AS model Live connections connection mode: normal execution

vjtianmsft_1-1725417942812.png

In my tests, switch and Percentlie line can be displayed in a visual, it should be noted that not all kinds of visual can use the Analytics fetures feature
The KPI card does not work with this feature

vjtianmsft_4-1725417994057.png

I think it might be due to the complexity of the calculations in SWITCH, the SWITCH command may cause all the conditions to be calculated when dealing with multiple conditions, which may affect the performance or raise an error. You can try to simplify the logic of the SWITCH command or break it down into multiple steps. For example, use variables to store intermediate results to reduce the amount of computation.
You can also try writing other MEASURES that use SWITCH function judgments (make sure you use the same data tables, control variables) but have simpler computation logic, place them in the same VISUAL and add Percentlie lines, and
See if the same problem occurs.
In this way, you can confirm that the problem you are experiencing is limited to that measure (dax code).

3. Try using IF functions or other functions instead of SWITCH.
Although the SWITCH function is implemented underneath by the IF function, I recommend that you try to use the IF function to create a new measure to achieve the effect of the original measure.

4. Check the version of Power BI Desktop you are using, I test the use of Power BI Desktop (RS version May)
You can try using a historical version of Power BI Desktop.

url:

Previous monthly updates to Power BI Desktop and the Power BI service - Power BI | Microsoft Learn

 

Please save your pbix file beforehand to avoid losing important data.

Could you share the test file (pbix file) and related screenshots that do not contain sensitive data and at the same time reproduce the problem, as well as the type of version of Desktop you are using (RS version or regular version) and the version number, which would help to resolve your issue.

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

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

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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