Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
shoeb1359
Helper II
Helper II

Create a flag for each id having duplicate values using Dax

Hello Experts,

I have stucked in a scenario where i need to create a language flag for each id using dax

Thanks in advance

 

IDLanguageLanguage Flag  (Output)
1EnglishBilingual
1ArabicBilingual
2 NA
3Englishmonolingual
4Arabicmonolingual
5ArabicBilingual
5EnglishBilingual
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@shoeb1359 

you can try this

 

Column =
var _count=CALCULATE(DISTINCTCOUNT('Table'[Language]),ALLEXCEPT('Table','Table'[ID]))
return if(_count=1 && 'Table'[Language]="","NA",if(_count=1,"monolingual","Bilingual"))
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
FlipFlop1
Advocate I
Advocate I

FlipFlop1_0-1725975475646.png

 

DAX:

Language Flag =
        VAR LanguageCount = CALCULATE(COUNT(Table1[ID]),ALLEXCEPT('Table1',Table1[ID]))
        RETURN
        IF(Table1[Language]=BLANK(), "NA",
        IF(LanguageCount=1, "Monolingual",
        IF(LanguageCount=2, "Bilingual")))
ryan_mayu
Super User
Super User

@shoeb1359 

you can try this

 

Column =
var _count=CALCULATE(DISTINCTCOUNT('Table'[Language]),ALLEXCEPT('Table','Table'[ID]))
return if(_count=1 && 'Table'[Language]="","NA",if(_count=1,"monolingual","Bilingual"))
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.