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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
LeonardCs
Helper I
Helper I

DAX

Hi guys,

 

I have a table with column 'number' and column 'name'.
At column 'number' some people has '00' and '02', and some people has '00' and outhers numbers.
I need a table with the name of all people that has only number '00' and outhers numbers.
I DON'T need the people that has '00' and '02' at same time (like bold text below)

 

Example:

 

number                   name

00                          Leonardo

05                          Leonardo

00                          Eduardo

02                          Eduardo

00                          Felipe

06                          Felipe

00                          Austin

00                         Will

02                         Will

 

 

 

My table need has Leonardo, Felipe and Austin.

Thank all and sorry my english. I'm Brazlian.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@LeonardCs You could create a Complex Selector like the following and then just filter for 1. PBIX is attached.

Flag Measure = 
    VAR __2s = COUNTROWS( FILTER( 'Table', [number] = "02" ))
    VAR __Result = IF( __2s > 0, 0, 1 )
RETURN
    __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1718644083614.png

 

 

Name new table =
VAR _list =
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS (
                VALUES ( data[name] ),
                "@condition", CALCULATE ( COUNTROWS ( FILTER ( data, data[number] IN { "00", "02" } ) ) )
            ),
            [@condition] <> 2
        ),
        data[name]
    )
RETURN
    FILTER ( data, data[name] IN _list )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

You understood correctly. Thank you so much for help me 🙏

Greg_Deckler
Super User
Super User

@LeonardCs You could create a Complex Selector like the following and then just filter for 1. PBIX is attached.

Flag Measure = 
    VAR __2s = COUNTROWS( FILTER( 'Table', [number] = "02" ))
    VAR __Result = IF( __2s > 0, 0, 1 )
RETURN
    __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you so much. The way that you solve was easy and I got replay in my data source

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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