Forum Discussion
DAX IF/THEN Statement
- 6 years ago
First, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Second, that is the symbol for a measure.
Third, guessing that [NumberOfUsers] is a column, you will need to use aggregation like so:
Measure = SWITCH(TRUE(); SUM([NumberOfUsers]) < 250; "SME"; SUM([NumberOfUsers]) < 1000 ; "Corporate"; SUM([NumberOfUsers]) < 5000 ; "Enterprise"; SUM([NumberOfUsers]) >= 5000 ; "Global"; BLANK())
First, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Second, that is the symbol for a measure.
Third, guessing that [NumberOfUsers] is a column, you will need to use aggregation like so:
Measure = SWITCH(TRUE();
SUM([NumberOfUsers]) < 250; "SME";
SUM([NumberOfUsers]) < 1000 ; "Corporate";
SUM([NumberOfUsers]) < 5000 ; "Enterprise";
SUM([NumberOfUsers]) >= 5000 ; "Global";
BLANK())Apologies - I should have read that post first. I will have a read shortly.
I get the attached error below when trying to use your formula, which I know is becuase I didn't explain myself properly but I am unable to share the actual data and so used another example, but forgot to clarify the data type...
This is the sort of thing I am trying to do, with the correct table name etc