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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi PowerBI users,
I'm trying to customise the data labels but I'm facing the issue here.
Here is stacked bar chart. I put....
Cost on X axis
Name on Y axis
Year on colour legend
The formula I use to calculate the custom labels
Year + Cost (label) =
VAR C = CALCULATE(SUM('Table1'[Total cost]), ALLEXCEPT('Table1','Table1'[VBD Name], 'Table1'[Year], Table1[Type]))
RETURN FORMAT('Table1'[Year], "YYYY") &": "& FORMAT(C,"$#,0")
as you can see when filtered the "Type" as C the cost in custom label and cost in the tooltip is the same
BUT when filtered "Type" with multiple options, the cost numbers go weird.
Custom label aggregration is changed to "First" and "Last" instead (cuz it's seen as text, it doesn't sum for me)
* Is there any way to calculate number when filtering multiple types? I want it to be dynamically changed when filtered.
I guess there is something wrong with the formula but I don't know how to solve this. Please help 😞
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...