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
Paskk
Regular Visitor

Create a new column using conditions

Hi, I would like to create the "Supplier administration service" column in the input table in which the first corresponding valid value of Supplier is indicated for each distinct building in the context where Service = "Cleaning service". Thank you very much.
This is the table with the expected results in the column to be created
BuildingServiceSupplierPurchase Value €OrdineSupplier Administration service
MilanCleaning servicePippo                     100.0001ABC Spa
FlorenceCleaning serviceFranco                       50.0002WYZ Srl
RomeCleaning servicePippo                       60.0003KKK Spa
Rome 2Cleaning serviceCarl                       20.000120"No one"
VeniceCleaning serviceTizio                       80.0004KKK Spa
TourinCleaning serviceCaio                       90.0005ABC Spa
ParisCleaning serviceSempronio                     100.0006ABC Spa
BoulogneCleaning serviceSempronio                       80.0007WYZ Srl
MilanAdministration serviceABC Spa                       10.0008 
FlorenceAdministration serviceWYZ Srl                       10.0009 
RomeAdministration serviceKKK Spa                       10.00010 
VeniceAdministration serviceKKK Spa                       10.00011 
TourinAdministration serviceABC Spa                       10.00012 
ParisAdministration serviceABC Spa                       10.00013 
BoulogneAdministration serviceWYZ Srl                       10.00014 
MilanOther servicesMonica                       15.000100 
FlorenceOther servicesSabrina                       20.000101 
RomeOther servicesDenise                       10.000102 
RomeOther servicesLilly                       12.000103 
VeniceOther servicesSabrina                       14.000104 
TourinOther servicesAnnalisa                       16.000105 
ParisOther servicesMaria                       11.000106 
BoulogneOther servicesSempronio                       13.000107 

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

 

 

Admin Service = 
IF(
    BLDG[Service] = "Cleaning service",
    COALESCE(
        CALCULATE(
            MAX( BLDG[Supplier] ),
            ALLEXCEPT( BLDG, BLDG[Building] ),
            BLDG[Service] = "Administration service"
        ),
        "No One"
    )
)

ThxAlot_0-1693083694295.png 



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

1 REPLY 1
ThxAlot
Super User
Super User

 

 

Admin Service = 
IF(
    BLDG[Service] = "Cleaning service",
    COALESCE(
        CALCULATE(
            MAX( BLDG[Supplier] ),
            ALLEXCEPT( BLDG, BLDG[Building] ),
            BLDG[Service] = "Administration service"
        ),
        "No One"
    )
)

ThxAlot_0-1693083694295.png 



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



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.