Forum Discussion

kc_1116's avatar
kc_1116
Frequent Visitor
9 months ago
Solved

Need help in using Field Parameter in Top N filter and Conditional Formatting

Hi,

 

I have a report that has conditional formatting and Top N filter on a static measure named IRR and it works perfectly. However, I want to change the measure to dynamic and allow user to select among a few other measures like DPI, RVPI and TVPI. I have created a Field Parameter and add all measures to it. It works for the bar chart at the bottom. However, I couldn't get the conditional formating to work. Also, the Top N filter based on that field parameter is not working properly. Can you advise how can I fix them, please? Thanks in advance.

 

URL of my Power BI Report: https://github.com/chris-kc-cheng/ftk-powerbi/blob/main/Private%20Markets.pbix

 

 

 

  • Hi kc_1116 ,

     

    In order to create conditional formatting for your bar chart, you can create a measure like below:

    Selected Metric Value = 
    VAR Selection = SELECTEDVALUE('Metric Selector'[Metric Selector Order])
    RETURN
    SWITCH( Selection,
        0, [M_IRR],
        1, [M_DPI],
        2, [M_RVPI],
        3, [M_TVPI],
        [M_IRR]
    )

    Then you can apply conditional color formatting in the bar:

    Set the conditional formatting like below:

    The resultant output is as shown blow:

     

     

    I have attached an example pbix file for your reference:


    Best regards,

     

     

4 Replies