Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pmadam
Helper II
Helper II

Conditional Formatiing help

Team,

 

I need help with having condional formating added in colors or icons for values when greater compared to previours year.

Eg /: countdata in values if its igreater than competitor previous year, it should give be green else red. 

 

Please help 

conditional.jpg

 

 

4 REPLIES 4
Anonymous
Not applicable

Hi @pmadam ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:

vheqmsft_0-1712717035449.png

Create a column

Color = 
VAR _t = 'Table'[Domain]
RETURN
IF(
    ISNUMBER(
        LOOKUPVALUE(
            'Table'[TotalCount],
            'Table'[Domain],
            _t,
            'Table'[PriceDate],
            DATEADD('Table'[PriceDate], -1, YEAR)
        )
    ),
    IF(
        'Table'[TotalCount] >
        LOOKUPVALUE(
            'Table'[TotalCount],
            'Table'[Domain],
            _t,
            'Table'[PriceDate],
            DATEADD('Table'[PriceDate], -1, YEAR)
        ),
        "green",
        "red"
    ),
    "green" 
)

Use the column as the filed value of conditional foramtting of the [TotalCount]

vheqmsft_3-1712717164237.png

 

vheqmsft_1-1712717123683.png

Final output

vheqmsft_2-1712717146851.png

Best regards,

Albert He

 

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

 

 

I get error msg " multiple values was supplied where a single value was expected" . Is it because of duplicated data in it. Please help with resolution

Anonymous
Not applicable

Hi @pmadam ,
Whether the problem has been solved. If there are other related issues you can continue to provide details below.

Best regards,

Albert He

 

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

Anonymous
Not applicable

Hi @pmadam ,
According to your description, this error occurs when two values are compared to each other, and you need to give both sides of the equation unique values to compare. In the previous code, the applicable case was to create a calculated column instead of measure.

Best regards,

Albert He

 

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.