Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Solved! Go to Solution.
Could you please explain the issue clearly? What is the visual you are using and what is the error you are getting ?
Welcome to the Microsoft Fabric Community Forum.
Regarding the issue with your color measure not working as expected in Power BI,while I’m not fully aware of the exact structure of your dataset, I’ve created a sample .pbix file to demonstrate one possible solution
The issue arises from the use of the AND() function inside a SWITCH(TRUE(), ...) statement. In DAX, while AND() returns a Boolean value, its use inside SWITCH(TRUE(), ...) can lead to unexpected behavior, especially when combining multiple conditions that evaluate values from a measure or column.
To resolve this, update DAX measure as follows:
ColorMeasure =
VAR Value = MAX(Rohdaten_E1[Pakete LZ nicht erreicht LZ E2E])
RETURN
SWITCH(
TRUE(),
Value <= 20, "#D3D3D3",
Value <= 50, "#FFDC00",
"#B40014"
)
I have attached a .PBIX, please take a moment to review them and see if this solution aligns with your requirements.
If this doesn’t fully meet your needs, could you kindly share a sample of your data and more detailed context? That would help us provide a more accurate solution. If you have any additional questions or require further assistance with implementing this measure in your visuals, please do not hesitate to follow up here.
If this response resolves your query, kindly mark it as Accepted Solution to help other community members. A Kudos is also appreciated if you found the response helpful.
Thank you!
Thanky you!
Welcome to the Microsoft Fabric Community Forum.
Regarding the issue with your color measure not working as expected in Power BI,while I’m not fully aware of the exact structure of your dataset, I’ve created a sample .pbix file to demonstrate one possible solution
The issue arises from the use of the AND() function inside a SWITCH(TRUE(), ...) statement. In DAX, while AND() returns a Boolean value, its use inside SWITCH(TRUE(), ...) can lead to unexpected behavior, especially when combining multiple conditions that evaluate values from a measure or column.
To resolve this, update DAX measure as follows:
ColorMeasure =
VAR Value = MAX(Rohdaten_E1[Pakete LZ nicht erreicht LZ E2E])
RETURN
SWITCH(
TRUE(),
Value <= 20, "#D3D3D3",
Value <= 50, "#FFDC00",
"#B40014"
)
I have attached a .PBIX, please take a moment to review them and see if this solution aligns with your requirements.
If this doesn’t fully meet your needs, could you kindly share a sample of your data and more detailed context? That would help us provide a more accurate solution. If you have any additional questions or require further assistance with implementing this measure in your visuals, please do not hesitate to follow up here.
If this response resolves your query, kindly mark it as Accepted Solution to help other community members. A Kudos is also appreciated if you found the response helpful.
Thank you!
Thank you for your time
Could you please explain the issue clearly? What is the visual you are using and what is the error you are getting ?