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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
KBO
Memorable Member
Memorable Member

Show values only of the exist in specific columns

Hi together,

I have a little DAX problem and as I mentioned before I'm no DAX crack XD.

So my problem today is:

 

  Germany France Spain Japan
Customer A 1 2 3 2
Customer B 2   2  
Customer C 1 2 2 3

 

Show values only If a Customer have a Sales in Germany and Spain but not If they sold in another country too.

 

Expected result:

  Germany France Spain Japan
         
Customer B 2   2  

 

Maybe this problem is easy but today is not my day :).

 

Best,

Kathrin

 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

@KBO , here's a measure solution for your reference,

Coverage = 
VAR __c =
    CALCULATETABLE (
        DISTINCT ( Sales[Country] ),
        ALLEXCEPT ( Sales, Sales[Customer] )
    )
VAR __filtered = FILTER ( __c, Sales[Country] IN { "Germany", "Spain" } )
RETURN
    IF ( COUNTROWS ( __c ) = COUNTROWS ( __filtered ), [Total] )

Screenshot 2021-03-07 031936.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

@KBO , here's a measure solution for your reference,

Coverage = 
VAR __c =
    CALCULATETABLE (
        DISTINCT ( Sales[Country] ),
        ALLEXCEPT ( Sales, Sales[Customer] )
    )
VAR __filtered = FILTER ( __c, Sales[Country] IN { "Germany", "Spain" } )
RETURN
    IF ( COUNTROWS ( __c ) = COUNTROWS ( __filtered ), [Total] )

Screenshot 2021-03-07 031936.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

KBO
Memorable Member
Memorable Member

Hi @CNENFRNL ,

thats a good solution! Now I only need to filter out all of the others but that's easy thanks!

 

Best,

Kathrin

rfigtree
Resolver III
Resolver III

mSales=sum(sales)

mAllCountrySales=calculate([mSales],all(Table[Country]))

mSalesSpainOrGermany=calculate([mSales],filter(all(table[Country]),table[Country]="Spain" || table[Country]="Germany"))

mSalesSpainOrGermanyOnly=if([mAllCountrySales]=[mSalesSpainOrGermany],[mSales],blank())

KBO
Memorable Member
Memorable Member

Hi @rfigtree ,

This dosn't work for my case ... I need a NOT IN from SQL into DAX but finally I solved my problem 😄 with visuals and filters 😉

But Thanks for helping.

 

Best,

Kathrin

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.