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
rkottap
Frequent Visitor

calculated field using MAXX with IF condition

Hi Team,

 

I need to create a caalculated field using MAXX & IF conditins if text is matching in a columns (Issue Type & Resolution) then add the text value for all the ID's in each row else Add the TEXT value from "Current Status".
Logic:
IF "Issue Type"="Feature" & "Resolution"  IN {"Canceled", "Cancelled"}  THEN "Cancelled"
EleseIF
IF "Issue Type"="Feature"  THEN [Current Status]
EndIF

Please see the attached screenshot for expected "Output" in column "E".

 

I have tried below DAX, but it's not giving the result for all the rows.

 

Please giude me to resolve this issue.

 

DAX:

Output =
CALCULATE(MAXX(FILTER(SUMMARIZE(TableName,

TableName [ID], TableName [Issue Type], TableName[Resolution], TableName[Current Status]),
TableName[Issue Type]="Feature" && TableName[Resolution] = "Canceled" || TableName[Resolution]="Cancelled")), "Cancelled"),
TableName[Issue Type]="Feature")


Screenshot:

Expected OutputExpected Output

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @rkottap 

 

Download PBIX file with example below

 

This works

 

Output = 

VAR _IsCancelled = COUNTROWS(FILTER(ALL('TableName'), 'TableName'[ID] = SELECTEDVALUE(TableName[ID]) && 'TableName'[Issue Type] = "Feature" && 'TableName'[Resolution] IN {"Cancelled", "Canceled"}))

VAR _InProgress = COUNTROWS(FILTER(ALL('TableName'), 'TableName'[ID] = SELECTEDVALUE(TableName[ID]) && 'TableName'[Issue Type] = "Feature" && 'TableName'[Current Status] = "In Progress"))

VAR _Review = COUNTROWS(FILTER(ALL('TableName'), 'TableName'[ID] = SELECTEDVALUE(TableName[ID]) && 'TableName'[Issue Type] = "Feature" && 'TableName'[Current Status] = "Review"))

RETURN

SWITCH(

    TRUE(),

    _IsCancelled = 1, "Cancelled",

    _InProgress = 1, "In Progress",

    _Review =1 , "Review"
)

 

issues1.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy 

Thank you for your response!

There are only two IF Conditions.

1:

IF "Issue Type"="Feature" & "Resolution"  IN {"Canceled", "Cancelled"}  THEN "Cancelled"

2: IF "Issue Type"="Feature"  THEN [Current Status]

Second IF condition should give the dynamic result from column "Current Status"?

 

Thank you 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.