Forum Discussion

kevinsray's avatar
kevinsray
Helper II
4 years ago
Solved

Column reflecting Conditional Formatting

Hi, Would really appreciate some help. Situation: Power BI report page has a slicer to get CustomerCompanyName. There is a table visual which shows top 100 sales products which is generated from ...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi kevinsray ,

    According to your description, I create a sample.

    top 100 sales products table:

    SalesTable:

    In my sample, in the last 6 month(2022/2/2-2022/8/1), only Company3 and Company4 has products in the top 100 sales products table, so the result should be N for Company1 and Company2, Y for Company3 and Company4. Here's my solution, create a measure.

    Measure =
    IF (
        COUNTROWS (
            FILTER (
                ALL ( 'SalesTable' ),
                'SalesTable'[CustomerCompanyName] = MAX ( 'SalesTable'[CustomerCompanyName] )
                    && 'SalesTable'[Product]
                        IN SELECTCOLUMNS (
                            'top 100 sales products',
                            "TOP", 'top 100 sales products'[top 100 sales products]
                        )
                            && 'SalesTable'[Date] IN DATESINPERIOD ( 'Date'[Date], TODAY (), -6, MONTH )
            )
        ) > 0,
        "Y",
        "N"
    )
    

    Get the result. In my understanding, the CustomerCompanyName slicer only for filtering the visual, but have no effect on the result of the measure.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.