The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Everyone,
Please can you help and advise.
i have customer data based on salary i have to create a category for Silver , Gold Diamond.
Salary range starts from 10,000 to 1000,000.
when i building this i am only getting Silver Category, i do not know as what is wrong am doing ....
Please can you include AND dax also OR dax inside IF dax. many thanks for your support in advance.
Solved! Go to Solution.
You can create a new column (not measure) and add the following rules
Column =
IF (
Table[amount] >= 0
&& Table[amount] < 30000,
"Silver",
IF (
Table[amount] > 30000
&& Table[amount] < 80000,
"Gold",
IF (
Table[amount] > 80000
&& Table[amount] < 100000,
"Platinum"
)
)
)
OR
Column =(
SWITCH( TRUE(),
Table[amount] >= 0 && Table[amount] < 30000, "Silver",
Table[amount] >= 30000 && Table[amount] < 80000, "Gold",
Table[amount] >= 80000 && Table[amount] < 100000, "Platinum",
"Other"
)
You can create a new column (not measure) and add the following rules
Column =
IF (
Table[amount] >= 0
&& Table[amount] < 30000,
"Silver",
IF (
Table[amount] > 30000
&& Table[amount] < 80000,
"Gold",
IF (
Table[amount] > 80000
&& Table[amount] < 100000,
"Platinum"
)
)
)
OR
Column =(
SWITCH( TRUE(),
Table[amount] >= 0 && Table[amount] < 30000, "Silver",
Table[amount] >= 30000 && Table[amount] < 80000, "Gold",
Table[amount] >= 80000 && Table[amount] < 100000, "Platinum",
"Other"
)
Thank you so much for making this so beautiful, the result make me so happy, I LOVE DAX. thanks again.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |