Conditional Formatting with Field Parameters in Power BI???

Поделиться
HTML-код
  • Опубликовано: 9 сен 2024

Комментарии • 73

  • @adolfojsocorro
    @adolfojsocorro 2 года назад +8

    Thanks for the video! I like Patrick's solution better because it's more maintainble to have the color values in a measure rather than buried in each formatting dialog box.

    • @fly_8659
      @fly_8659 2 года назад +2

      100%
      I moved to a different workplace and don't have the same set of tools that I would normally use... Power BI is one of the few things that I have available.
      I really appreciate the power that's under the hood... but it can be so tediousness when you're working on a complex set of transformations only to realize you've gone down the wrong path to your solution and have to rewrite a bunch of stuff... I'm getting RSI on my mouse hand wishing I could open the entire project in VS Code and do a regex find replace

  • @jimwinny
    @jimwinny 2 года назад +2

    Excellent video! I was faced with this same question a few weeks ago. I went the DAX route, but wrote a switch statement like this:
    Table Metric (Conditional Formatting) =
    SWITCH(
    SELECTEDVALUE('Table Metric'[Table Metric Fields]),
    "'Metrics'[Metric A]", FORMAT('Metrics'[Metric A], "###,###"),
    "'Metrics'[Metric B - %]", FORMAT('Metrics'[Metric B - %], "##.#%"),
    "'Metrics'[Metric C]", FORMAT('Metrics'[Metric C], "###,###")
    )
    Note that I wrapped the Switch values in double quotes. I typed the metric names using intellisense, then added the quotes to all 3 lines at the end.
    This Table Metric (Conditional Formatting) replaces the field parameter and goes into the values well of my matrix, and I have everything that I wanted. The numbers are formatted appropriately (as percentages or whole numbers), and there is conditional formatting of the metric values.
    The one downside is that I needed to select one specific measure to conditionally format the table, regardless of which measure was selected. The benefit, compared to this method, is that it allows use of all of the standard conditional formatting options, including gradient conditional formatting.
    I love your videos and thank you for keeping us up to date and for sharing your incredible knowledge!
    Cheers!

  • @matthiask4602
    @matthiask4602 2 года назад +3

    I love that video. And I love that Matthias guy.

  • @melvinmoses1739
    @melvinmoses1739 Год назад

    Thank you so much !!! This saved me hours of searching the internet for a solution !!!!

  • @benelphick1071
    @benelphick1071 5 месяцев назад

    Fantastic to come here and find the exact solution I needed. Thanks guys!!

  • @dsswooshy
    @dsswooshy Год назад

    You absolutely rock !! I did have the idea to look in the visual itself but couldn't see an option so headed off to bed (was working late). Then i saw this video and got up again and went back to work. 2 beautiful solutions, I prefer the clicky version. Thanks guys !!

  • @NothingMatters
    @NothingMatters 18 дней назад

    Absolute Saviour! love it

  • @isabelaosoriomartinez7165
    @isabelaosoriomartinez7165 Год назад +1

    I tried to do this same exercise but with a bar graph but it didn't work. Anyway thank you very much!!

  • @achillelanna3833
    @achillelanna3833 2 года назад

    Thanks Adam: defintely your way!!!

  • @RueKanda
    @RueKanda 2 года назад +1

    Thanks for the tip!
    Anyone here been able to figure out c.formatting on other visuals? (ie. Pie charts, bar graphs)

  • @morinho96
    @morinho96 Месяц назад

    that works only when you don't change the measures given to the visual, for example if I have a bar chart that uses a field parameters to remove or add bars, the colors get reset everytime you add or remove a measure...

  • @steven-el3sw
    @steven-el3sw Год назад

    Gotta go with Patrick's way on this one 🙂

  • @sengottuvelnachimuthu7796
    @sengottuvelnachimuthu7796 Год назад

    Awesome 2 ways to achieve Conditional Formatting. Let me know Performance wise which approach is better. Is it click or DAX.

  • @akhilannan
    @akhilannan 2 года назад +1

    Interesting. I thought ISSELECTEDMEASURE only works in Calculation groups. How is it working inside a normal measure ?

  • @pahadianalyst
    @pahadianalyst Год назад

    You guys are freakishly amaaaazinnnnnggggggg!!!!!🙇🙇🙇

  • @tomkochka2058
    @tomkochka2058 6 месяцев назад

    is there a way to make the conditional formatting change depending on what filters are selected?

  • @bravucod
    @bravucod 2 года назад

    Thanks Adam.! I would say like with anything it depends

  • @parthlad5630
    @parthlad5630 Год назад +1

    Thanks for the video, Adam! I was wondering, is there a way we could use SELECTEDMEASURE() function to dynamically select measures and get different colors for conditional formatting. E.g, SELECTEDMEASURE () > 0 , "Green".

  • @googlogmob
    @googlogmob 2 года назад

    Cool. Thanks guys!

  • @DranickMann
    @DranickMann Год назад

    Patrick's solution better when you use different what if for each measure.

  • @losantosw
    @losantosw 9 месяцев назад

    Thanks for the video! help me a lot!

  • @ojasshandilya4362
    @ojasshandilya4362 2 месяца назад

    Can we do the same in filled maps?

  • @andrewrice3225
    @andrewrice3225 5 месяцев назад

    There’s a hack here. If you want to use the standard PBI conditional formatting.. add the original measure (that you want to format) from your model to your visual alongside your parameter, add your conditional formatting to the measure, then remove the measure from your visual.. you’ll find it sticks when using it in the field parameter too :)

  • @mariuszowczarek1875
    @mariuszowczarek1875 2 года назад

    Both ways are great!

  • @alicedwonderland7733
    @alicedwonderland7733 2 года назад

    I might go with Patrick's way because I need to display one selection as 'thousands' and another as numbers - say, Invoice Amount and Client Count. And this is for a VISUAL. I can do that with conditional formatting within the table, interestingly enough.

    • @cptdeadeye2112
      @cptdeadeye2112 2 года назад

      Field parameters will retain the metrics' format either way.

  • @annatsilevitch3409
    @annatsilevitch3409 Год назад

    Hello and tnx for a great video. Is there a chance to change color of the parameter button itself?

  • @hectordavila6249
    @hectordavila6249 Год назад

    Excellent video!! Is it possible to add a minigraphic for a field parameter? Im a fan of sparklines and it would be amazing to be able tu use this.

  • @craftychaos6189
    @craftychaos6189 11 месяцев назад

    I'm trying to make this work on my visual, but I have a dynamic X and Y axis and I believe my other dynamic axis is kind of blocking the DAX from working properly. Any assistance would be appreciated!

  • @charlottep.4843
    @charlottep.4843 2 года назад

    Thank you !

  • @tinaflemons263
    @tinaflemons263 2 года назад

    Awesome, Can you calculate a Top N or summarize on Field Parameters to create a tool tip or to write a summary? If so, can you do a video?

  • @AdamMarks
    @AdamMarks 2 года назад

    I had an issue doing conditional formatting on a field parameter that is used for the rows or columns in a table. But I found that if you add that field to the table manually, set conditional formatting then remove the field (since it's contained in the field parameter), the conditional formatting remains on that columns included in the field parameter.

  • @mandarnandre7387
    @mandarnandre7387 2 года назад

    Which one is better performance wise?

  • @janetteagnese
    @janetteagnese 2 года назад

    Team Patrick 🖤

  • @kadirkkkk
    @kadirkkkk Год назад

    4:30 For the choropleth maps visual that method does not work :(

  • @Simon-vc1wk
    @Simon-vc1wk 2 года назад

    I figure this out recently too. However I was wondering how to take this further. Support you want different visuals for various FP listed in the slicer, how can this be achieved. So far I though if having multiple FP with synch slicer somehow. You might want bar chart for some items in the slicer list or line graph for others?

  • @krishnakishorepeddisetti4387
    @krishnakishorepeddisetti4387 2 года назад

    I like both of you guys... But for this.. I will take your suggestion Adam.. 🙂🙂

  • @namanmittal9349
    @namanmittal9349 Год назад

    How can we use this measure to conditionally format col/row totals as well ?

  • @samanthachartrel7721
    @samanthachartrel7721 Год назад

    Thank you for the video. Would it be possible to have a different conditional formatting but for the same measure? I would need to differentiate the measure's background color over time (selected field would be Q1, Q2, Q3 and Q4). If anyone could assist, I would be soooo happy.

  • @balajikomma541
    @balajikomma541 2 года назад

    Kindly provide DAX based scenarios questions to practice or any url links related to it

  • @jatinsrivastava6061
    @jatinsrivastava6061 2 года назад +1

    But it's only for one measure how we add for all measures in one go

  • @ola5422
    @ola5422 7 месяцев назад

    Hello, I have a very important question, I am currently putting together a dashboard and I have two different matrices, one that reflects the sales of last year and one of the current one, I need that if the value of the current matrix has higher values than the previous one, it is green. , otherwise it is red, the problem is that the value field is not a table, it is a measure created that talks about the DispatchRatePercent. How could I do this with conditional formatting

  • @oscariglesias1268
    @oscariglesias1268 2 года назад

    To calculate the percentages in a table or matrix, SWITCH and ISINSCOPE were used, but now the field parameters (which users can set the number they want and in the order they want) how can it be calculated so that the result is correct when the user adds, deletes and changes the order of the field parameters?

  • @abhaydwiveddi3760
    @abhaydwiveddi3760 2 года назад

    thanks for this video it is very helpful....
    I also have a question I have a power bi report in which I am using multiple datasets and report being refresh in every 15 minutes.....
    but some of datasets not being update in every 15 minutes so if it is possible to refresh those dataset in different frequency and the dataset updates in every 15 minutes refresh in every 15 minutes.

  • @DarkOri3nt
    @DarkOri3nt 2 года назад

    Can formatting be done with a local measure? When connecting to an aas tabular instance aswell. I tried and the measures were greyed out.

  • @nyekoKimmy
    @nyekoKimmy 2 года назад

    Hey, trying to connect a parameter to a slicer for dynamic loading of my data right now. Somehow nothing i tried is working thus far - any ideas?

  • @Anthony_Lecoq
    @Anthony_Lecoq 2 года назад

    Great video, depends on the need of the user, if the target is variable or a measure, DAX feels to be the way to go ;)

  • @coynessglory3
    @coynessglory3 10 месяцев назад

    Q: i have a similar problem, pls help. In my value, I have my field parameter. (Total sales of current week, past week, etc). So one measure being field parameter. Then on my bar graph axis, i have my products. However i want to not only highlight current week but different color for each product. How to do this ??

  • @gyo_dj
    @gyo_dj Год назад

    Patrick's solution is not working on Azure Maps bars.. When you go through each selection, the conditional formatting resets.

  • @cptdeadeye2112
    @cptdeadeye2112 2 года назад

    I would use Patrick's way if the conditional formatting is applied to multiple visuals, so I may reuse the logic.

  • @anusharaj2313
    @anusharaj2313 Год назад

    Hi, i need some help on how to conditional format on multi kpi card?
    I know we can use conditional formatting on normal card.
    Would be helpful if someone can help

  • @jasonhimmelstein
    @jasonhimmelstein 2 года назад +1

    I am a fan of the clicky-clicky way

    • @sisgir7280
      @sisgir7280 2 года назад

      I figured this out when I was trying to add Select All to the Field Parameters

  • @larl07
    @larl07 2 года назад

    Yours, but I would look for other ways of visualizing this instead. I can't imagine having to do this for each selection, especially if I rely so heavily on filtering via other visuals..

  • @brennovn
    @brennovn 2 года назад

    Your videos are excellent, guys! Congratulations!!!
    I'm still a beginner in DAX and I feel I could accomplish my goal if I do something slightly different. Let me explain... I have 3 Field Parameters (Revenue, Cost, and Gross Profit) and 1 bar chart where the user may see 3, 2, or 1 of the measures. I want to color the bar according to the parameter chosen. For example, if the user selects Revenue, make the bars green, if the user selects Cost, make the bar orange, otherwise (Gross Profit) make it blue.
    Could someone help me, please?

    • @kar2194
      @kar2194 9 месяцев назад

      Hi I am also into this and couldn't find a solution, have you found a solution and could you share with me please?

  • @mehdik2032
    @mehdik2032 2 года назад

    The challenge is now to make it works with calculation group AND field parameters 😉

  • @kfasekk
    @kfasekk 6 месяцев назад

    hey so I know it's been a year already but I just noticed that the dax code in the video doesn't work. You may notice that the values that should be formatted the same color are not. This is because ISSELECTEDMEASURE returns false which makes the entire thing default to _tq.

    • @priyadarshinielumalai6024
      @priyadarshinielumalai6024 5 месяцев назад

      Hi yes! it is returning only false. Did you find any other way to make this work?

    • @kfasekk
      @kfasekk 5 месяцев назад

      @priyadarshinielumalai6024 it should work while using calculation groups I guess. Otherwise two different conditional formatting measures

    • @priyadarshinielumalai6024
      @priyadarshinielumalai6024 5 месяцев назад

      @@kfasekk I just made it to work with selected value instead of isselectedmeasure

  • @gyo_dj
    @gyo_dj Год назад

    Plus ISSELECTEDMEASURE does not work any more

  • @georgecook5120
    @georgecook5120 2 года назад +1

    Thanks for the video! I would use DAX because "real developers" use DAX. Of course, I'm kidding. I would lean toward DAX because I'm learning it and I like writing code.

  • @Mucahtkutlu
    @Mucahtkutlu Год назад

    I have a field parameter with 1K measures :D and doing it for each of them :( OMG!

  • @ChrisWagnerDatagod
    @ChrisWagnerDatagod 2 года назад +1

    $1 in the jar

  • @danielmudie605
    @danielmudie605 2 года назад

    I choose crazy DAX everytime

  • @Focus1234xyz
    @Focus1234xyz 2 года назад

    based on my situation i will go the Dax way

  • @balajikomma541
    @balajikomma541 2 года назад

    Sir

  • @sharonwoloshin6003
    @sharonwoloshin6003 2 года назад

    Definitely clicks (sorry, Patrick)!

  • @mwaltercpa
    @mwaltercpa 2 года назад

    $1

  • @rickmarciniak2985
    @rickmarciniak2985 2 года назад

    clicks, all day....

  • @stuartsaint4581
    @stuartsaint4581 8 месяцев назад

    I find your lack of faith in DAX disturbing.