Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
Solved! Go to Solution.
@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] )
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 , 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] )
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! |
Hi @CNENFRNL ,
thats a good solution! Now I only need to filter out all of the others but that's easy thanks!
Best,
Kathrin
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())
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |