Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
hey there,,
as shown below I want to format my stacked bar with the percentage conditional formatting, the issue happened by adding two X-axis measures in the visual..
is there a way to add conditional formatting while having two X-axis?
here is the BI file sample.pbix
thanks.
Hi @Saud19999 ,
Do you need to have the white bar until the 100%?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Saud19999 ,
Do the following:
ClusterCalculation =
VAR _Valueto100 =
1 - DIVIDE ( [Last day all clusters - tank], SUM ( Capacity[Capacity] ) )
RETURN
IF (
SELECTEDVALUE ( Capacity[Cluster] ) <> BLANK (),
SWITCH (
TRUE (),
SELECTEDVALUE ( Categories[Subcat] ) = "Diff"
&& DIVIDE ( [Last day all clusters - tank], SUM ( Capacity[Capacity] ) )
- MIN ( Categories[Minimum] ) >= 0
&& DIVIDE ( [Last day all clusters - tank], SUM ( Capacity[Capacity] ) )
- MAX ( Categories[Maximum] ) <= 0, _Valueto100,
IF (
DIVIDE ( [Last day all clusters - tank], SUM ( Capacity[Capacity] ) )
- MIN ( Categories[Minimum] ) >= 0
&& DIVIDE ( [Last day all clusters - tank], SUM ( Capacity[Capacity] ) )
- MAX ( Categories[Maximum] ) <= 0,
DIVIDE ( [Last day all clusters - tank], SUM ( Capacity[Capacity] ) )
)
)
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank you @MFelix for you time and help.
It's working for only3 colors , whan there is a green or yelow case it does not show it.
is there anyway solution around it?
In the example I created there was only 3 groups with data because when there a no values it returns blank, when you have more groups go to the colours and select the correct colour for the specific value.
If that does not work can you tell me the filters you are applying so I can get more than. 2 colors.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêsthank you again for your fast answer,
your example is splendid, however, it has some blank values even though there are data (shown below).
and if you could please add the 2 colours your solution would be perfect
also is there a way to sort the values based on their value? from highest to lowest.
thank you again
Hi @Saud19999 ,
Check the file updated attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêsgreat, now all colors are visible, but I still have an issue with blank values even though it's not empty..
also, the visual works excellent when there is a month selected but in my case, it's a trend for the whole year so I cant use filters
as you can see here a comparison with filter and without.
Can you tell me wich one is correct? So I can check the calculations
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Saud19999 ,
When you refer that you are adding two axis you mean you are using the legend to make the colours correct?
Power BI does not allow to have condittional formatting while using the legend or more than one measure on the values.
The file is asking for login can you share it again please.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêsyes, that's correct..
I tried opening the file and it opens without any problem, you can download it directly
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.