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.
My chart displays several colors and I'd like to list them in the measure, but I keep receiving an error message that says the syntax is not correct. I do not want to create one measure per color either.
Solved! Go to Solution.
Hi @dli9 ,
Create a new table contains color column and has no relationship with the original table.
Slicer table = distinct(colortable[color])
Then use this table as color slicer and modify the measure as below.
Scaled Volume Measure =
IF(
MAX( ColorsTable[ColorsTable]) IN VALUES('Slicer table'[color]),
[Raw Volume Total] * [Power BI Scale],
[Raw Volume Total]
)
Best Regards,
Jay
Hi,
Does this measure work?
=if(MAX(ColorsTable[ColorsTable])="Red"||MAX(ColorsTable[ColorsTable])="Yellow"||MAX(ColorsTable[ColorsTable])="Blue"||MAX(ColorsTable[ColorsTable])="Orange",[Raw Volume Total] * [Power BI Scale],[Raw Volume Total])
@dli9
Could be this :
Scaled Volume Measure =
IF(
MAX( ColorsTable[ColorsTable]) IN {"Red","Yellow", "Blue","Orange"},
[Raw Volume Total] * [Power BI Scale],
[Raw Volume Total]
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
That worked! However, I'm running into the issue of all my colors being scaled now when I filter by All Colors. For example, if I filter color by Green and Scale by 1.5, I want to see the bar chart for green move whilst the rest remain the same. I also don't want a bar graph that only shows Green.
Hi @dli9 ,
Create a new table contains color column and has no relationship with the original table.
Slicer table = distinct(colortable[color])
Then use this table as color slicer and modify the measure as below.
Scaled Volume Measure =
IF(
MAX( ColorsTable[ColorsTable]) IN VALUES('Slicer table'[color]),
[Raw Volume Total] * [Power BI Scale],
[Raw Volume Total]
)
Best Regards,
Jay
Great, this works. If I filtered by one color and only want to see that color, would I just replace Slicertable [color] with Colorstable[color]. Using the example earlier, if I filter color by Green and Scale by 1.5, I want to ONLY want to see green with the scaled number.
Scaled Volume Measure =
IF(
MAX( ColorsTable[ColorsTable]) IN VALUES('ColorsTable[ColorsTable]),
[Raw Volume Total] * [Power BI Scale],
[Raw Volume Total]
)
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 |
---|---|
114 | |
100 | |
74 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |