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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Convert Tableau calculation to Power BI

1.  COUNTD(if UPPER([ TYPE 1 ])='MAJOR' THEN [NAMES]END)
2.  RANK_UNIQUE(COUNTD([TYPE 1]))

How to conver this tableau functions into Power BI dax ?

1 ACCEPTED SOLUTION

@Anonymous , Sorry double quote. try search

 

countx(filter( table, search("MAJOR",Table[ TYPE 1 ],,0) >0) , Table[Name])

 

or

 

countx(filter( table, UPPER(Table[ TYPE 1 ])='MAJOR'), Table[Name])

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,

countx(filter( table, UPPER(Table[ TYPE 1 ])='MAJOR'), Table[Name])

or


countax(filter( table, UPPER(Table[ TYPE 1 ])='MAJOR'), Table[Name])

 

2. RANK_UNIQUE(COUNTD([TYPE 1])) -- there is no unique rank
Rank Tie breaker
https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-Columns/ba-p/918655
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

Anonymous
Not applicable

I have tried the first function, it is not giving me result, it only give me a blank values .

@Anonymous , Sorry double quote. try search

 

countx(filter( table, search("MAJOR",Table[ TYPE 1 ],,0) >0) , Table[Name])

 

or

 

countx(filter( table, UPPER(Table[ TYPE 1 ])='MAJOR'), Table[Name])

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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