Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
I have a table like this with a live data connection,
Timestamp Value1 Value2
16/06/2020 1:00 10 3
16/06/2020 2:00 12 23
16/06/2020 3:00 4 11
16/06/2020 4:00 2 5
I have plotted a scatterplot with Value1 vs Value2. As the timestamp increases the density of the scatterplot increases. Therefore, i would like to show the last N values in a different color.
For ex, if value1 vs value2 is plotted in blue color, lets say N is 2. I want (4,11) and (2,5) to be displayed in red color. This should be possible for different N values. N represents the number of values to be shown from the last timestamp.
Could someone help me on this. Thanks
Solved! Go to Solution.
Hi, @pbidemouser2
Based on your dsecription, I created data with live connection to reproduce your scenario.
Tab:
You may create a measure as below.
Rank =
RANKX(
ALL(Tab),
CALCULATE(SUM(Tab[Timestamp]))
)
You may make the visual selected, go to 'Visualizations', click 'Format'=>'Data coclors', click conditional formatting for the visual, set as below.
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @pbidemouser2
Based on your dsecription, I created data with live connection to reproduce your scenario.
Tab:
You may create a measure as below.
Rank =
RANKX(
ALL(Tab),
CALCULATE(SUM(Tab[Timestamp]))
)
You may make the visual selected, go to 'Visualizations', click 'Format'=>'Data coclors', click conditional formatting for the visual, set as below.
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-alq-msft ,
Thanks for the solution. This almost solves my problem. But the only issue is, you are putting rank>2 in the conditional format. In a live connection, there will be many timestamps coming in. In that case there will be a lot of points after rank 2.
So, for example if there are 10 rows also, i want to show the last 2 rows only. I hope there is some way to solve that. Thanks
Hi, @pbidemouser2
The rankx function sorts by timestamps from hign to low by default. So you can set the rule as 'if [Rank]<=2 then red' to show the last two rows only.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@pbidemouser2 , Create a measure that return color based on codition
example:
Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))
color =
switch ( true(),
FIRSTNONBLANK(Table[commodity],"NA") ="commodity1" && sum(Table[Value]) >500,"lightgreen",
FIRSTNONBLANK(Table[commodity],"NA") ="commodity2" && sum(Table[Value]) >1000,"lightgreen",
/// Add more conditions
"red"
)
You have use sum of value1 or value 2.
Then in data in data color use fx - conditional formatting. In that choose field option and color measure
refer for steps
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
94 | |
90 | |
35 | |
35 |
User | Count |
---|---|
154 | |
100 | |
82 | |
63 | |
53 |