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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Calculated measure based on column values

I have a table with the following columns

Case#, Utilities, UtilityStatus

 

Each Case# has 4 utilites, let's call them A,B, C and D. Each utilities has the following status depending on current situation: complete and pending.

I want to have a measure that returns Complete if all 4 utilities are 'Complete' and Partial otherwise for each Case#

 

For illustration purposes:

Case#  Utilities  UtilityStatus

1111    A            Complete

1111    B            Complete

1111    C            Complete

1111    D            Complete

 

2222    A            Complete

2222    B            Complete

2222    C            Pending

2222    D           Complete

 

I want the measure to return Complete for 1111 & Partial for 2222

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

 

Measure =
var _table = summarize(Table, Table[Case#], "_1", Count(Table[Utilities]) , "_2", countx(filter(Table, Table[UtilityStatus] ="Complete"),Table[Utilities]))
return
maxx(_table, if([_1] =[_2], "Complete", "Partial"))

 

 

or

 

Measure =
var _table = summarize(Table, Table[Case#], "_1", Count(Table[Utilities]) , "_2", countx(filter(Table, Table[UtilityStatus] ="Complete"),Table[Utilities]))
return
calculate( maxx(_table, if([_1] =[_2], "Complete", "Partial")), allexcept(Table, Table[Case#]))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try like

 

Measure =
var _table = summarize(Table, Table[Case#], "_1", Count(Table[Utilities]) , "_2", countx(filter(Table, Table[UtilityStatus] ="Complete"),Table[Utilities]))
return
maxx(_table, if([_1] =[_2], "Complete", "Partial"))

 

 

or

 

Measure =
var _table = summarize(Table, Table[Case#], "_1", Count(Table[Utilities]) , "_2", countx(filter(Table, Table[UtilityStatus] ="Complete"),Table[Utilities]))
return
calculate( maxx(_table, if([_1] =[_2], "Complete", "Partial")), allexcept(Table, Table[Case#]))

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.