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.
Hello,
I am trying to change some names in my column, but I am not sure how to give column names as default or on else. Can anybody please tell me. Please see below image,
The isseu is I am not sure how to reffer colunm name in If stament.
Thank you so much
Solved! Go to Solution.
@bikelley , Syntax is wrong , In dax it like
if([_rep>3] ,3,_rep) //if(<condition>, <then> ,<else>)
or is ||
and is &&
refer: https://docs.microsoft.com/en-us/dax/if-function-dax
Hi @bikelley
You cold try the following measure:
new accountname =
IF (
'Account Name'[Ac+A1:A19count Name-Hierarchy level 2] = "Ch"
|| 'Account Name'[Ac+A1:A19count Name-Hierarchy level 2] = "Chi"
|| 'Account Name'[Ac+A1:A19count Name-Hierarchy level 2] = "Chic",
"Chico",
'Account Name'[Ac+A1:A19count Name-Hierarchy level 2]
)
final you will get like below:
DAX IF:https://docs.microsoft.com/en-us/dax/if-function-dax
or in dax:||
and in dax:&&
if i answer your question,pls Mark my post as a solution,thanks!
Best Regard
Lucien Wang
Hi @bikelley
You cold try the following measure:
new accountname =
IF (
'Account Name'[Ac+A1:A19count Name-Hierarchy level 2] = "Ch"
|| 'Account Name'[Ac+A1:A19count Name-Hierarchy level 2] = "Chi"
|| 'Account Name'[Ac+A1:A19count Name-Hierarchy level 2] = "Chic",
"Chico",
'Account Name'[Ac+A1:A19count Name-Hierarchy level 2]
)
final you will get like below:
DAX IF:https://docs.microsoft.com/en-us/dax/if-function-dax
or in dax:||
and in dax:&&
if i answer your question,pls Mark my post as a solution,thanks!
Best Regard
Lucien Wang
@v-luwang-msft Thank you so much this works well for me too. Again, thanks for the help.
@bikelley , Syntax is wrong , In dax it like
if([_rep>3] ,3,_rep) //if(<condition>, <then> ,<else>)
or is ||
and is &&