Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I need to reflect value on a column chart in both absolute and percentage (in relate to other number) value. Example below.
In order to do so, I used format string expression in tabular editor. After many different tries I figured out something as below:
var wyk = FORMAT ( [Wykonanie], "\#,0;-\#,0;\#,0" ) var wyk_p = FORMAT ( [Wykonanie %], "0,0%;-0,0%;0,0%" ) return if ( selectedmeasurename() = "Wykonanie", CONCATENATE ( wyk, " / " & wyk_p ) )
but it formats the values in very strange manner (first row is correct - direcetly from measures, second row is result of format string expression).
Can anyone advise how I can resolve this? Thanks, Kamil
Hello guys,
thanks for prompt response. Unfortunetly your solutions does not resolve my issue. When I use your syntax in Tabular Editor it returns below formatting. I cannot simply create text measure as you do, because I need to reflect it on column chart. Any advice...? 🙂
@KamilSzpyrka
I am not sure why the percentage doesn't work, you can use pre-defined percentage formating as this:
var wyk_p = FORMAT ( MAX(SomethingSomething[Something2]), "Percent")
And the rest, try @SergioSilvaPT solution for the Condition, implement his logic and my formatting.
It still returns very strange values. Please note the absolute value is incorrect as well... Kamil
@KamilSzpyrka , can you try my solution please to check?
Because you're using to create a calculation groups and there you need the selectedmeasure() function.
Hi @KamilSzpyrka ,
You can achieve the requested result with this measure:
IF(
selectedmeasurename() = "Wykonanie",
FORMAT([Wykonanie], "0.##") & " / " & FORMAT([Wykonanie %], "##.##%")
)
Regards,
Sérgio Silva
Hi, @KamilSzpyrka
Try something like this:
Formatting =
var wyk = FORMAT ( MAX(SomethingSomething[Something]), "#,###,###.00")
var wyk_p = FORMAT ( MAX(SomethingSomething[Something2]), "##.00%")
return wyk & " / "& wyk_p
@vojtechsima why you used the MAX function inside the FORMAT?
Hi, @SergioSilvaPT
Just to make my sample data work, it is not necessary, but I didn't have row context so I had to help myself with MAX.
OK, thanks for the explanation!
That's the beauty of Power BI and Data Analysis, you don't have one unique solution, you have many that can be used to achieve our requirements! 😊
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
105 | |
88 | |
74 | |
66 |
User | Count |
---|---|
126 | |
111 | |
100 | |
83 | |
71 |