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
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
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.