Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
this dax code returns an error in power bi, the error I get when I put the measure in a table is "error fetching data for this visual" then when clicking see details: "an unexpected exception has occurred".
this is the code:
Y Axis Max Finance Bar Chart-error =
VAR __tbl =
CALCULATETABLE(
SUMMARIZECOLUMNS(
DimDate[Month Short & Year],
FactProfitLossActualTGC,
"@Actual",
[gl act amount],
"@LastYear",
[GL LY Amount]
),
ALLSELECTED( DimDate )
)
VAR __max_actual = MAXX( __tbl, [@Actual] )
VAR __max_ly = MAXX(__tbl, [@LastYear] )
VAR __max_all = MAX( __max_actual, __max_ly )
RETURN
__max_actual
if i change the code by separating the 2 tables with actual & last year to the following it works ok:
Y Axis Max Finance Bar Chart working =
VAR __tbl =
CALCULATETABLE(
SUMMARIZECOLUMNS(
DimDate[Month Short & Year],
FactProfitLossActualTGC,
"@Actual",
[gl act amount]
),
ALLSELECTED( DimDate )
)
VAR __tbl_LY =
CALCULATETABLE(
SUMMARIZECOLUMNS(
DimDate[Month Short & Year],
FactProfitLossActualTGC,
"@LastYear",
[GL LY Amount]
),
ALLSELECTED( DimDate )
)
VAR __max_actual = MAXX( __tbl, [@Actual] )
VAR __max_ly = MAXX(__tbl_LY, [@LastYear])
VAR __max_both = MAX( __max_actual , __max_ly )
RETURN
__max_both
the addittion of [GL LY Amount] to the same summarise table causes issues, I don't know why.
This is are the base measures:
GL Act Amount =
VAR __tbl =
DimChartOfAccountsPL
VAR __filter_out_blank =
FILTER(
__tbl,
DimChartOfAccountsPL[AccountCategory] <> "Sales" &&
DimChartOfAccountsPL[AccountCategory] <> "Other Income"
)
VAR __sumx =
SUMX(
__filter_out_blank,
[GL Act Amount SUM]
)
VAR __switch_sales_sign =
FILTER(
__tbl,
OR(
DimChartOfAccountsPL[AccountCategory] = "Sales" ,
DimChartOfAccountsPL[AccountCategory] = "Other Income"
)
)
VAR __sumx_sales =
SUMX(
__switch_sales_sign,
-[GL Act Amount SUM]
)
RETURN
__sumx + __sumx_sales
GL LY Amount =
CALCULATE(
[GL Act Amount],
DATEADD(DimDate[Date], -1, YEAR)
)
If i check windows event viewer, i get the following error under applications:
The description for Event ID 22 from source MSOLAP$AnalysisServicesWorkspace_abfbb409-a75e-4623-b6c8-d3b99933c438 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
An unexpected exception occurred. An unexpected exception occurred.
The message resource is present but the message was not found in the message table
I have installed the latest analysis services client libaries but still get the same error. Any ideas on why this error is happening?
client libraries: https://learn.microsoft.com/en-us/analysis-services/client-libraries?view=asallproducts-allversions
I'm on Nov 24 PBI desktop version.
Hi @timosborn ,
Please provide sample PBIX files. Check if the problem can be reproduced on my end.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, I have a similar problem and I know how to reproduce it:
Create a new report
Add a DimDate table using:
DimDate = CALENDAR( DATE(2024, 1, 1), TODAY() )
3. Add a slicer using the Date column from DimDate
4. Create a measure
CurrentDate = MAX(DimDate[Date])
5. Add a card visual showing the CurrentDate measure
At first, everything works perfectly.
If I adjust the upper bound of the slicer, the card updates correctly.
But when I adjust the lower bound of the slicer (to move the start date forward), the card breaks and gives the "See details" error: "Error fetching data for this visual" "An unexpected error occurred (file '', line , function '')"
Now, if I change the measure to:
CurrentDate = MAX(DimDate[Date].[Date])
it works again, even with the lower bound adjusted.
Why would simply adjusting the lower bound of the slicer cause this issue? And why does adding `.[Date]` magically fix it?
The weirdest part is that this was working fine two weeks ago (same laptop).
I'm not sure if it's relevant, but I'm running Power BI on Parallels on an M1 MacBook.
From today the exact same thing happens to me, so some WINDOWS update is causing the failure. I also have Paralles on a MacBook M3, and 2 days ago this worked perfectly with the same file. I've restarted, reinstalled POWER BI DESKTOP, and nothing. If the same thing happens to you and you have found the solution, let it indicate. The error you see in the event viewer is this same -->
... event id 22 of the origen MSOLAP$AnalysisServicesWorkspace...
I created a new issue: https://community.fabric.microsoft.com/t5/Desktop/Weird-behavior-with-date-slicer-and-MAX-measure-on...
@jemgrant73 mentioned in the issue that this happened to him while working with Windows, so it's not exclusively related to Parallel
its not related to exact files, something wrong with system
There are just some previous WINDOWS updates and now this error happens, I would have to escalate the problem to ensure that it is the cause of this not working on computers that use Parallels with WINDOWS on a MAC with Apple Silicon CPU (M1, M2, M3, M4...).