March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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?
@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-values
icon 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
I dont know any other way to explain it, and dont think that example is what I'm looking for
I just want to know the status of the device base on the time stamp columns, green if its on red if its off.
@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
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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
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
I think im al most there, how do you create a measure that turn a True column into ones and zeros
hi @Anonymous
Share some simple sample data and your expected output, that will be a great help.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Regards,
Lin
Hi
Sorry for the delay, here basically what I wanted, I have a column that has "Acttive" or "Inactive". I worte an if statement that add a new column with 1's and 0's (what you see in the picture). If that value is 1 then the color with be Green to let me know that machine is active. I wanted the DeviceName to change colors if the device was active or not. But this is the best solution I could come up with .
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |