Forum Discussion
Switch True
Hi
I am working on an power bi report, I have two columns with the time stamp, one is for when an opreater scans in to the device and one for when they have scanned out. Im not sure if the Switch True Function is the fountion that I need. But I would like to have a visual that will turn green if they are logged into the decive and red it they are not. Is that possible?
9 Replies
- parry2kSuper User
Anonymous not fully clear what you are trying to achieve, paste some sample data, and expected output. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490- AnonymousNot applicable
In the picture below are the start and end time for different devices. I want to know is it possible to create a visual using the SwitchTrue() function, that will change colors if someone has scanned in or out of that device
- v-lili6-msftCommunity Support
hi Anonymous
This a "start date and end date" problem, very common, you could refer to this similar post:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365
If you still have problem, please share some simple sample data and what your expected output like.
Regards,
Lin
- amitchandakSuper User
Anonymous , not very clear. But you can create a color measure. and use that using "Field value" option conditional formatting
example measure
Color = if(FIRSTNONBLANK(Table[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170 ,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow")) Color sales = if([Sales Today] -[sales yesterday]>0,"green","red") 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" )https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-valuesicon formatting
https://exceleratorbi.com.au/conditional-formatting-using-icons-in-power-bi/
https://community.powerbi.com/t5/Desktop/FORMAT-icon-set-for-use-in-a-data-card/td-p/811692- AnonymousNot applicable
I dont know any other way to explain it, and dont think that example is what I'm looking for
- AnonymousNot applicable
I just want to know the status of the device base on the time stamp columns, green if its on red if its off.