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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Dear all,
I want to create a measure showing the number of employees in a bar chart. If a year or multiple months are filtered in the report I want the data labels of the bar chart to display one decimal place because then the values are means, otherwise none because then they are integers. I tried a lot of things including different formulas per condition, but it did not help. The number of decimal places set in the format section of the report seem to be dominant and overwrite any formula. So I tried to change the datatype via CONVERT: DOUBLE for the means and INTEGER otherwise. However INTEGER does not seem to be a valid argument, although it should work (https://docs.microsoft.com/de-de/dax/convert-function-dax). Further the option to change the datatype in the modeling section is greyed out and set to decimal number, although I think that would not help either, because the visual format setting seems to dominant. Is there any possible solution for this problem?
Kind regards
My code:
EmployeesBars =
SWITCH (
TRUE ()
; ISFILTERED(Di_Month[Year]) || ISFILTERED(Di_Month[Month]) && NOT HASONEVALUE(Di_Month[Month]); CONVERT(FORMAT(CALCULATE([⌀Employees]; Di_Wirkungsmonat[Status]="V"); "#.0"); DOUBLE)
; HASONEVALUE(Di_Month[MonthYearText]); CONVERT(SUM(Fa_Employment[Count])); INTEGER) --does not accept INTEGER here (error: "name could not be found")
)
Hi @Frith ,
Try this measure
EmployeesBars =
SWITCH (
TRUE ();
ISFILTERED ( Di_Month[Year] )
|| ISFILTERED ( Di_Month[Month] )
&& NOT (
HASONEVALUE ( Di_Month[Month] )
); CONVERT (
FORMAT (
CALCULATE (
[Employees];
Di_Wirkungsmonat[Status] = "V"
);
"#.0"
);
DOUBLE
);
HASONEVALUE ( Di_Month[MonthYearText] ); FORMAT (
CONVERT (
SUM ( Fa_Employment[Count] );
DOUBLE
);
"#"
)
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
8 | |
4 | |
3 |
User | Count |
---|---|
15 | |
15 | |
11 | |
10 | |
10 |