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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
cookiemonsterBI
Regular Visitor

Custom label with text and number altogether

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")

1.png
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 😞
2.png

1 REPLY 1
lbendlin
Super User
Super User

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...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors