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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
meghansh
Frequent Visitor

Need help with calculated column

Hello everyone,

 

I need help creating a calculated column with the following data and conditions:

IDNameCourse CodeEnd DateResult
12345RobertRed21-Mar-21Pass
12345RobertRed24-Apr-22Pending
12345RobertRed Pending
12345RobertBlue23-May-23Pending
12345RobertBlue30-Mar-24Pending
64537GeorgeRed31-May-23Pending
64537GeorgeRed31-Aug-23Pending

 


The requirement is to create a calculated column called "indicator" which fulfils this requirement:

1) If these both conditions are met: End Date is Blank and Result = Pending, then marks "Yes" for all rows with same Course Code for an ID. If these conditions are not met for any row, then mark "No".

The result shout be like:

IDNameCourse CodeEnd DateResultIndicator
12345RobertRed21-Mar-21PassYes
12345RobertRed24-Apr-22PendingYes
12345RobertRed PendingYes
12345RobertBlue23-May-23PendingNo
12345RobertBlue30-Mar-24PendingNo
64537GeorgeRed31-May-23PendingNo
64537GeorgeRed31-Aug-23PendingNo
2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Indicator = 
var i = [ID] var cc=[Course Code]
var a = Filter('Table',[ID]=i && [Course Code]=cc && [Result]="Pending" && ISBLANK([End Date]))
return if(COUNTROWS(a)>0,"Yes","No")

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Course Code]=EARLIER(Data[Course Code])&&Data[End Date]=BLANK()&&Data[Result]="pending"))>0,"Yes","No")

Hope this helps.

Ashish_Mathur_0-1739751995629.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @meghansh ,

Thanks for all the replies!
And @meghansh , please check whether their solutions will help you solve your problem?
If solved please accept the reply in this post which you think is helpful as a solution to help more others facing the same problem to find a solution quickly, thank you very much!

Best Regards,
Dino Tao

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[ID]=EARLIER(Data[ID])&&Data[Course Code]=EARLIER(Data[Course Code])&&Data[End Date]=BLANK()&&Data[Result]="pending"))>0,"Yes","No")

Hope this helps.

Ashish_Mathur_0-1739751995629.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Indicator = 
var i = [ID] var cc=[Course Code]
var a = Filter('Table',[ID]=i && [Course Code]=cc && [Result]="Pending" && ISBLANK([End Date]))
return if(COUNTROWS(a)>0,"Yes","No")
Irwan
Super User
Super User

hello @meghansh 

 

i think there are other ways to achive your need this but i would do something as below.

Irwan_3-1739747297723.png

 

1. create a new table to match the requirement (blank value in end date and result is pending).

Irwan_0-1739747117349.png

Summarize = 
SUMMARIZE(
    FILTER(
        'Table',
        ISBLANK('Table'[End Date])&&
        'Table'[Result]="Pending"
    ),
    'Table'[ID],
    'Table'[Name],
    'Table'[Course Code]
)
2. create a new calculated column with following DAX.
Irwan_2-1739747263617.png
Indicator = 
var _Value =
MAXX(
    FILTER(
        'Summarize',
        'Table'[Course Code]='Summarize'[Course Code]&&
        'Table'[ID]='Summarize'[ID]
    ),
    1
)
Return
IF(
    _Value=1,
    "Yes",
    "No"
)
 
Hope this will help.
Thank you.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.