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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
saukulkarni22
Frequent Visitor

Get Status column based on another column status

Hi,

 

Wondering anyone can help me here please?

saukulkarni22_0-1678789040968.png

I am looking generate final status column based PO status and ID. If all PO status is Yes then final status will be Yes, all PO status is No then final status will be No PO, if mixed then returned as Partial for those ID. My PO status column is calulated column based on PO ref using power query.

 

Thanks

4 REPLIES 4
Aburar_123
Resolver IV
Resolver IV

Hi @saukulkarni22 ,

 

Please use the below calculated column,

 

Final_State =
 var a = CALCULATE(max('Table'[PO Status]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID])))
  var b = CALCULATE(MIN('Table'[PO Status]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID])))
  return if(a<>b,"Partial",a)

 

Hi,

 

Thanks for reply. But forgot to mention I am using direct query and calculate is not supported in direct query for calculated column DAX expression.

andhiii079845
Super User
Super User

I recommanded to bring this summerize status in a separate table with the ID column

IDFinal status
1YES
2Partial
3NO PO
  




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi,

 

This could work. Could you provide more details on this.

 

Thanks

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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