Forum Discussion

jcawley's avatar
jcawley
Helper III
4 years ago
Solved

Label Column based on other Column Value

Good afternoon Power BI Community,   I’m having a problem with a column. Let’s say I have a table with two columns. One that lists Invoice Number, and another that lists Color. I want to create a c...
  • Ashish_Mathur's avatar
    4 years ago

    Hi,

    This calculated column formula works

    =if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Invoice Number]=EARLIER(Data[Invoice Number])&&Data[Color]="Blue"))>0,"Blue"
    ,Data[Color])

    Hope this helps