Forum Discussion
Help_me
5 months agoFrequent Visitor
How to write this IF statement for same date, but different statuses?
Hello, I have the two columns below in the same table. "Cookie Type" is text field and "Baked_Date" is a date value. How can I write the IF statement in DAX for the concept: If the same baked_date ...
- 5 months ago
Calculated column:
Eat Flag =
VAR CurrentDate = 'Table'[Baked_Date]
RETURN
IF(
CALCULATE(
COUNTROWS('Table'),
'Table'[Baked_Date] = CurrentDate,
'Table'[Cookie Type] IN {"Chewy", "Chunky"}
) = 2,
"Eat",
"Do not eat"
)Checks if both Chewy + Chunky exist on same Baked_Date.
lbendlin
5 months agoSuper User
How can I write the IF statement in DAX
write to where? A calculated column? A measure?
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523