Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Conditional Formatting in Matrix Visual

I have a matrix visual showing data of 4 months. Computers name in row field, dates of 4 months in Column field and CPU average of every computer in Value field. I want to change background colour of highest CPU average for every month . How can I achieve this in Power BI ?

 

  • Hi Anonymous , 

    Thanks for sharing the dataset again. Using the dataset, the output is coming for FEB month as below : 

    For March: 

     

    Please follow the steps given below to get the above output : 

    • Please create a month column if it is not already present in the dataset :
    • Create below 2 measures (Max_CPU_Average and ConditionalFormatting1) and follow the steps given in previous reply to use the ConditionalFormatting1 measure to get the background color

       


       

      If this resolves your problem, please select it as the solution

     

    Thanks,

    Ankita

8 Replies

  • foodd's avatar
    foodd
    Icon for Community Champion rankCommunity Champion

    Hello Anonymous , and thank you for sharing a question with the Community.  The following is informational.  Please remember to adhere to the decorum of the Community Forum when asking a question.

    Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

    https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523/highlight/true#M607150

    This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      As requested due to some restriction i'm unable to upload excel file however i have attached the dataset in this message body.

       

      Row Labels01-Feb02-Feb03-Feb04-Feb05-Feb06-Feb07-Feb08-Feb09-Feb10-Feb11-Feb12-Feb13-Feb14-Feb15-Feb16-Feb17-Feb18-Feb19-Feb20-Feb21-Feb22-Feb23-Feb24-Feb25-Feb26-Feb27-Feb28-Feb29-Feb
      ABC3.2457762.931062.9481092.9066012.9948023.088093.0524783.0331933.0204422.9603063.0227922.9958763.0469063.1204453.0575522.9952273.0229752.9851783.0418123.1008193.24543.228643.4533133.3959113.4149933.2333463.3262813.2305413.209912
      EFG7.0196716.9547426.8741466.9447716.9453596.9866656.9640156.838286.8528046.977126.9557086.920426.9816497.104237.0921117.0905957.7473397.3911846.6557846.6419576.7933726.6063656.7440896.837376.8597166.8429786.7879136.7820146.930302
      HIG4.2150814.2056734.3528424.3034394.3387034.3693634.135544.1153884.0881867.4878787.14756.9169147.080977.1505087.0529567.0617697.9718218.3911336.8897377.0884277.3350727.4011377.5363867.759157.6962688.2339057.9532497.6666727.713544

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi,

        I am re-phrasing my problem area again.

        I have a matrix visual showing data of 4 months. Computers name in row field, dates of 4 months in Column field and CPU average of every computer in Value field. I want to change background colour of highest value for every month and for every comupter name i.e; each row should have 4 values should get highligted and same could be applicable for all rows in the matrix. Kindly Help me with the resolution

         

        Here i'm attaching the whole data set for better understanding

         

        Row Labels01-Feb02-Feb03-Feb04-Feb05-Feb06-Feb07-Feb08-Feb09-Feb10-Feb11-Feb12-Feb13-Feb14-Feb15-Feb16-Feb17-Feb18-Feb19-Feb20-Feb21-Feb22-Feb23-Feb24-Feb25-Feb26-Feb27-Feb28-Feb29-Feb01-Mar02-Mar03-Mar04-Mar05-Mar06-Mar07-Mar08-Mar09-Mar10-Mar11-Mar12-Mar13-Mar14-Mar15-Mar16-Mar17-Mar18-Mar19-Mar20-Mar21-Mar22-Mar23-Mar24-Mar25-Mar26-Mar27-Mar28-Mar29-Mar30-Mar31-Mar01-Apr02-Apr03-Apr04-Apr05-Apr06-Apr07-Apr08-Apr09-Apr10-Apr11-Apr12-Apr13-Apr14-Apr15-Apr16-Apr17-Apr18-Apr19-Apr20-Apr21-Apr22-Apr23-Apr24-Apr25-Apr26-Apr27-Apr28-Apr29-Apr30-Apr01-May02-May03-May04-May05-May06-May07-May08-May09-May10-May11-May12-May13-May14-May15-May16-May17-May18-May19-May20-May21-May22-May23-May24-May25-May26-May27-May28-May29-May30-May31-May
        ABC3.2457762.931062.9481092.9066012.9948023.088093.0524783.0331933.0204422.9603063.0227922.9958763.0469063.1204453.0575522.9952273.0229752.9851783.0418123.1008193.24543.228643.4533133.3959113.4149933.2333463.3262813.2305413.2099123.069393.0862763.2149923.3324293.5319874.380174.4545824.2037124.2276274.1716334.1642954.338944.1915724.2004474.1277754.1781994.2221384.332984.5129864.2832423.0613613.1137643.0658133.068663.7364583.016042.8199982.6290122.5734572.612352.7461122.8478282.9494042.9911713.0433213.026263.1531123.1222013.2593993.1601833.1875813.5984523.2461373.2664163.3364743.3048113.2308294.041983.8249733.1908453.0506272.9263642.9779293.0070473.0182912.9560352.8769662.9078452.8506542.9366492.9315532.918972.9364273.0217413.0105622.8494082.8209512.7401972.8018532.8708822.9043152.9236122.8562692.8293122.7337212.7369082.9496093.2510452.9026973.035282.9810832.9429722.8885512.8502212.9848663.0043552.8816542.9263322.9844513.0028784.0199964.093973
        DEF7.0196716.9547426.8741466.9447716.9453596.9866656.9640156.838286.8528046.977126.9557086.920426.9816497.104237.0921117.0905957.7473397.3911846.6557846.6419576.7933726.6063656.7440896.837376.8597166.8429786.7879136.7820146.9303026.6417576.7184696.9479476.8463556.9725916.9093076.9642816.9104157.0035296.9831616.9743637.0434526.9392536.988316.910658.3500347.3822847.3007357.304397.7851137.3210047.3250019.4033497.2984257.4958327.865257.4876287.5288577.6573937.5101959.2862677.2252477.896227.8821577.8957367.7646317.8861437.9811457.8485937.8660197.8218037.8999747.858867.9103278.1322378.075128.0131018.0901567.9299457.8532428.9320729.254618.0818718.0337377.8237917.7269447.8785827.8306067.8784617.8808388.4123427.4433048.009617.9740678.2486118.0436258.0940248.0974098.010788.2287289.32739.000569.0366779.1540889.454818.7585098.7635288.6565968.380268.4371698.3892228.3989488.4458848.8544288.722048.5081438.6374868.7078398.5027168.4974728.6907149.198497
        GHI4.2150814.2056734.3528424.3034394.3387034.3693634.135544.1153884.0881867.4878787.14756.9169147.080977.1505087.0529567.0617697.9718218.3911336.8897377.0884277.3350727.4011377.5363867.759157.6962688.2339057.9532497.6666727.7135447.4607957.5196067.6837157.5942927.9102697.9617737.9997847.8306657.9839328.1708648.4390538.3098348.2760488.4154858.4594598.5651667.0010956.8910047.2913397.8174137.1077177.1211677.1186487.2913547.4516927.5232317.5934397.4611747.5572487.5213868.830437.3097117.9985098.0775158.3493788.3738898.3371728.6121388.4611168.5902888.3355428.4608448.3998918.3461528.5026938.5690578.6094248.528668.4568078.531659.2393627.5877019.0412517.6794857.8296517.600957.7344137.6977427.5906757.6727298.1881527.9841018.0779378.1569738.1259227.8938858.0294768.1495727.9472398.1300459.1327599.0303059.0858748.9397949.2943678.4357598.7142468.8209958.902329.130379.214279.359149.459229.8012449.9560069.9399519.8553779.96189310.819999.62589710.2369110.11735
        JKL6.9855126.7711796.4200136.5991746.9214346.6923046.6483546.6721066.837026.3750736.4511946.6972116.9116996.9402176.8509096.9329086.8691876.8655226.9267396.9552896.9922287.0207857.1002267.1386657.1857747.1168797.155797.0752337.0812236.5392436.3039096.6557666.8585076.8434066.766816.8821037.5034827.0900467.1532726.7058736.9865626.9320127.2439667.1302817.2107777.2789947.3882627.4187657.3420447.3793437.3930877.3332237.4404717.4485557.5238057.372667.3888477.5167597.342947.3925437.3701797.8261977.8018217.8988137.862418.1727817.7471367.9573147.8533877.7596887.8558327.8660729.0863227.6042697.4842977.6193217.6824139.2374877.6261257.6393797.612547.5519867.7350467.6491457.6053157.6898577.6454177.7760517.760027.765197.5638517.6718237.8313587.8508867.5461457.688577.7908667.6899477.9239018.9326068.7465568.8589918.7847378.6628968.5719298.8115238.7245418.8340738.7905758.8974978.749178.9993238.9065578.9890488.8460099.0521239.1450748.7560138.8506918.8017478.743147

         

  • Hi Anonymous , 
    If your expected output is as shown below where the max value is highlighted in the matrix : 


    Then please follow below steps : 
     

    • create a measure with below DAX where Sheet1[Value] is your average of CPU column : 
    • go to format your visual ---> under Cell Elements ---> choose your series -->bacground color---> click on 'fx' function 
    • use the conditionalformatting measure created in step 1 as shown below : 


      If this resolves your issue, please select the reply as your solution.

     


     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi , 

      I have followed the same steps but still it's not working.

      • AnkitaaMishra's avatar
        AnkitaaMishra
        Icon for Super User rankSuper User

        Could you please share the error or DAX that you have implemented?