Forum Discussion
Anonymous
4 years agoNot applicable
DAX - IF, AND & OR
Hello - I'm trying to write a DAX formula but seem to be falling short, not sure if this can be achieved by 'adding a new column' within BI: Example Question: Within the UK, we have X amoun...
- 4 years ago
Hi Anonymous
Try this oneColumn = SWITCH(TRUE(),'Table'[Country] = "UK" && 'Table'[Gender] = "Female" && 'Table'[Ethnicity]="Black" || 'Table'[Ethnicity]="Arabic", "Yes","No")Then you can countrows
= Calculate(Count('Table'[Country]),'Table'[Column] = "Yes")If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos - 4 years ago
You could do it with a calculated column but I would suggest a measure like:
# Needed = CALCULATE ( COUNTROWS ( Sheet1 ), Sheet1[Ethnicity] IN { "Black", "Arabic" }, Sheet1[Gender] = "Female" )
PijushRoy
Community Champion
4 years agoHi Anonymous
Try this one
Column = SWITCH(
TRUE(),
'Table'[Country] = "UK" && 'Table'[Gender] = "Female" && 'Table'[Ethnicity]="Black" || 'Table'[Ethnicity]="Arabic", "Yes",
"No")
Then you can countrows
= Calculate(Count('Table'[Country]),'Table'[Column] = "Yes")
= Calculate(Count('Table'[Country]),'Table'[Column] = "Yes")
If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos
- Anonymous4 years agoNot applicable
Thank you this worked!