Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I´m quite new into Power BI and I would like to create a column based on the following condition:
If a user has more than one market assigned (each row repeats the username and the unique market) I would like to call it as "EMEA", if the user has just a market, I would like the name of the market.
Any help is welcome 🙂
Solved! Go to Solution.
Hi @JorgeRG ,
Try the following calculated column:
column =
IF (
COUNTROWS (
FILTER (
GROUPBY ( 'Table', 'Table'[User_Principal_Name], 'Table'[Market_Name] ),
'Table'[User_Principal_Name] = EARLIER ( 'Table'[User_Principal_Name] )
)
) = 1,
'Table'[Market_Name],
"EMEA"
)
If this works let me know so I can place it on the post:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@Anonymous , a new column
column =
var _1 = countx(filter(Table, [username] =earlier([user name]) , [Market Name]) +0
return
if(_1 >=1 , [User Name] & [Market Name] , [Market Name] )
Thanks @amitchandak for your reply!
I forgot to add the structure of the table. Maybe this helps to see the column that I would like to get:
Hi @JorgeRG ,
Try the following calculated column:
column =
IF (
COUNTROWS (
FILTER (
GROUPBY ( 'Table', 'Table'[User_Principal_Name], 'Table'[Market_Name] ),
'Table'[User_Principal_Name] = EARLIER ( 'Table'[User_Principal_Name] )
)
) = 1,
'Table'[Market_Name],
"EMEA"
)
If this works let me know so I can place it on the post:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
116 | |
73 | |
62 | |
48 | |
47 |
User | Count |
---|---|
173 | |
123 | |
60 | |
59 | |
57 |