DAX - Using SWITCH() to change the background colour in a Power BI table

Тәжірибелік нұсқаулар және стиль

Power BI - Using the DAX SWITCH() function to change the background colour of a cell in a Power BI table. In this video I provide an example of the cell colour changing based upon the number of dates to a project deadline.
In Power BI DAX SWITCH() works a bit like a multiple-choice question. The SWITCH statement is given a value (here, the number of days to the deadline) and it gives you back a result (here, the cell colour).
This example provides a basic template of a SWITCH function which a user can expand upon for more complex conditions than that shown.
Timings:
00:00 - 01:10 Introduction
01:10 - 02:30 Create Measure to calculated number of days to deadline
02:30 - 05:40 Create Measure with SWITCH() statement to change cell colours
05:40 - 07:30 Recap steps taken and talk through example
07:30 - 08:30 Apply Measure containing SWITCH to cells of table.
#powerbi #powerbicolours #DAXSWITCH #SWITCH() #SWITCHfunction #powerbitutorial #dax #ChangeCellColour #changebackgroundcolor

Пікірлер: 34

  • @debbieking8688
    @debbieking86885 ай бұрын

    Thank you very much indeed - that was exactly what I was looking for. Worked a treat. 🙂

  • @DFK_data

    @DFK_data

    5 ай бұрын

    Thanks! Glad you found the video helpful.

  • @MsKaryn
    @MsKaryn Жыл бұрын

    This was perfect, simple, and video well done! Thank you!

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Thank you!

  • @pupu41784
    @pupu417842 жыл бұрын

    Thank you so much for making this video. I needed this!

  • @DFK_data

    @DFK_data

    2 жыл бұрын

    Thank you! Glad I could help

  • @kebincui
    @kebincui Жыл бұрын

    Very good and clear tutorial👍🏻👍🏻👍🏻

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Glad you found the video helpful. Thanks!

  • @fengchenwei8311
    @fengchenwei8311 Жыл бұрын

    Thanks a lot!!!!!!!! This video helps me a lot!

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Thank you! Glad you found the video helpful.

  • @rafaelnardi4915
    @rafaelnardi4915 Жыл бұрын

    Thank you for the video

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Glad you enjoyed the video!

  • @jayong2370
    @jayong2370 Жыл бұрын

    Thank you. This worked perfectly. =)

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Thank you! I'm glad you found the video helpful

  • @joserochefort7778
    @joserochefort7778Ай бұрын

    it helped a lot merci

  • @DFK_data

    @DFK_data

    Ай бұрын

    Thanks! Glad you found the video helpful

  • @TradeWithKola
    @TradeWithKola4 ай бұрын

    Nice and well detailed video.

  • @DFK_data

    @DFK_data

    4 ай бұрын

    Thank you!

  • @kotid3376
    @kotid33762 жыл бұрын

    Thank you so much👌

  • @DFK_data

    @DFK_data

    2 жыл бұрын

    Thank you for watching the video

  • @laviecest5811
    @laviecest58118 ай бұрын

    Amazing

  • @DFK_data

    @DFK_data

    8 ай бұрын

    Thank you!

  • @amrindersingh9165
    @amrindersingh91652 жыл бұрын

    Very Good mam

  • @DFK_data

    @DFK_data

    2 жыл бұрын

    Thank you!

  • @stjepan_8902
    @stjepan_8902 Жыл бұрын

    Thanks! Do you know if it's possible to dynamically set values and their colors with SWITCH() based on a column's distinct values? I can't hardcode values(too many and will probably change after refresh), but I need all distinct values colored differently (not count of distinct, no aggregations, just color each value with different color)

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Hi, thanks for watching the video. Apologise, from your question I am not 100% clear on what you are trying to achieve. Perhaps Microsoft's Power BI community can suggest a solution if you provide an example of what you expect the final output to look like.

  • @aluib7994
    @aluib79942 жыл бұрын

    Hello, I watched your video but I can't assign the calculated object to the table, they appear disabled, what can I do? Thanks

  • @DFK_data

    @DFK_data

    2 жыл бұрын

    Hi, thanks for watching my video. Apologise, I am not fully understanding your question as I'm not clear on what is disabled. Do you have full edit rights to the Power BI report you are using? Perhaps someone else on KZread has come across this issue in relation to measures and tables and can help, or alternatively the Microsoft Power BI community is helpful as there you have the ability to provide screen prints of what is showing as disabled. Hope this helps.

  • @rambabuette7635
    @rambabuette7635 Жыл бұрын

    Hai ma'am, if a cell contain text related information like Pass/Fail, Fail=Missing then how i can change colour in power bi

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Hi, if you put the relevant column/measure into the switch statement and tell it on which values to change colour that should hopefully work. If you need help with your specific code, perhaps the Microsoft Power BI Community can help you.

  • @LvUhcX
    @LvUhcX2 жыл бұрын

    how to do an entire specific row?? not just text

  • @DFK_data

    @DFK_data

    2 жыл бұрын

    Hi, I am not exactly clear what you are looking for, perhaps some else on KZread has created a video which provides an answer to your query. Alternatively Microsoft's Power BI Community may be able to assist you.

  • @mosunmolaoyeleye1097
    @mosunmolaoyeleye1097 Жыл бұрын

    what if the task deadline was different for every task

  • @DFK_data

    @DFK_data

    Жыл бұрын

    Hi, thanks for watching the video. Apologise I am not clear on the question as in the example the tasks do have different deadlines. Perhaps someone in Microsoft's Power BI community can help if you provide an example. Hope this helps.

Келесі