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.
Hi All,
Newbie here! I am trying to highlight my bar chart based on highest and lowest sales value by each month. I tried to write the below measure and used conditional formatting under data colors but it is giving all months same color.
Solved! Go to Solution.
Hi @sandeepreddy ,
You need to redo your measure to:
Min&Max =
VAR temp_table =
SUMMARIZE ( ALL ( Dates ); Dates[Month]; Dates[Year]; "Sales"; [TotalSales] )
VAR MAXIMUM =
MAXX (
FILTER ( temp_table; Dates[Year] = SELECTEDVALUE ( Dates[Year] ) );
[Sales]
)
VAR MINIMUM =
MINX (
FILTER ( temp_table; Dates[Year] = SELECTEDVALUE ( Dates[Year] ) );
[Sales]
)
RETURN
SWITCH (
TRUE ();
[TotalSales] = MAXIMUM; "Green";
[TotalSales] = MINIMUM; "Red"
)
Check result below and PBIX attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @sandeepreddy ,
You need to redo your measure to:
Min&Max =
VAR temp_table =
SUMMARIZE ( ALL ( Dates ); Dates[Month]; Dates[Year]; "Sales"; [TotalSales] )
VAR MAXIMUM =
MAXX (
FILTER ( temp_table; Dates[Year] = SELECTEDVALUE ( Dates[Year] ) );
[Sales]
)
VAR MINIMUM =
MINX (
FILTER ( temp_table; Dates[Year] = SELECTEDVALUE ( Dates[Year] ) );
[Sales]
)
RETURN
SWITCH (
TRUE ();
[TotalSales] = MAXIMUM; "Green";
[TotalSales] = MINIMUM; "Red"
)
Check result below and PBIX attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |