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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I want to create and show a division, but card visual shows 'Error fetching data for this visual'. Here is my code:
Solved! Go to Solution.
Hi @SandorTS
Thanks for the reply from danextian .
I created a sample data to do the test and everything shows up fine. If my sample data is different from the data structure you are using, then please provide some sample data and expected results based on the sample data so that we can help you better. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
My sample:
Measure:
Measure =
VAR _aaa =
CALCULATE(
SUM('Consolidated table'[Cost]),
'Consolidated table'[Data Source] <> "X"
)
VAR _bbb =
CALCULATE(
SUM('Consolidated table'[Cost]),
'Consolidated table'[Data Source] = "X"
)
VAR _osszeg =
Divide(_aaa, _bbb)
RETURN
_osszeg
Output:
For measure, I set it to show two decimals, sometimes the default may not show decimals, then the result will show 0.
Also, what I need to confirm with you is whether the error is in Power BI desktop or Power BI Service? What is your data source?
If it's appearing in Service, I found a couple of posts with similar error reporting for your reference:
The solution to this post is to remove the semicolon from the SQL query in the Advanced Editor.
Solved: Couldn't load the data for this visual - Microsoft Fabric Community
One solution in this post is to check the permissions of the gateway.
Solved: Re: Error fetching data for this visual - Microsoft Fabric Community
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SandorTS
Thanks for the reply from danextian .
I created a sample data to do the test and everything shows up fine. If my sample data is different from the data structure you are using, then please provide some sample data and expected results based on the sample data so that we can help you better. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
My sample:
Measure:
Measure =
VAR _aaa =
CALCULATE(
SUM('Consolidated table'[Cost]),
'Consolidated table'[Data Source] <> "X"
)
VAR _bbb =
CALCULATE(
SUM('Consolidated table'[Cost]),
'Consolidated table'[Data Source] = "X"
)
VAR _osszeg =
Divide(_aaa, _bbb)
RETURN
_osszeg
Output:
For measure, I set it to show two decimals, sometimes the default may not show decimals, then the result will show 0.
Also, what I need to confirm with you is whether the error is in Power BI desktop or Power BI Service? What is your data source?
If it's appearing in Service, I found a couple of posts with similar error reporting for your reference:
The solution to this post is to remove the semicolon from the SQL query in the Advanced Editor.
Solved: Couldn't load the data for this visual - Microsoft Fabric Community
One solution in this post is to check the permissions of the gateway.
Solved: Re: Error fetching data for this visual - Microsoft Fabric Community
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Why the need to use VALUE() when the results of the first two variables are already numeric?
I have tried to debug it before I checked _aaa and _bbb value. You are right, VALUE() isn't needed.
(Still not working of course)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |