Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have two tables in my power bi model:
a. SalesFact table which contains sales per employee by dates and b.SalesEmployees which hold the salesperson's details
My goal is to show for each date a list of the salesperson with no sales on that date. (page has date slicer)
to calculate this "anti join" table I wrote this table function:
antijoin table =
EXCEPT (
SELECTCOLUMNS ( SalesPersons, "ID", SalesPersons[worker id] ),
SELECTCOLUMNS ( 'Salesfact', "ID", 'Salesfact'[worker id] )
)
The problem here is that the function does not take the user selection of date slicer into consideration
meaning it is calculating the anti join between the whole SalesFact table and SalesEmployees table regardless of the date chosen
how can I achieve my desired goal?
Solved! Go to Solution.
Hi @Adidas ,
I think this is what you want.
Pbix file is attached with the solution
https://community.powerbi.com/t5/Desktop/Count-of-Customers-with-no-Sales/td-p/589155
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Adidas ,
I think this is what you want.
Pbix file is attached with the solution
https://community.powerbi.com/t5/Desktop/Count-of-Customers-with-no-Sales/td-p/589155
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Thank you all for your kind help
it works fine now
@Adidas , you can use inside a measure, but costly stuff for measure
antijoin table =
countx(
EXCEPT (
SELECTCOLUMNS ( SalesPersons, "ID", SalesPersons[worker id] ),
SELECTCOLUMNS ( 'Salesfact', "ID", 'Salesfact'[worker id] )
) ,[worker id] )
Thanks amitchandak
I created the measure as you suggested
Hi
forgot to mention I'm on a direct query mode
cant use the query editor here
I should perform it by pure dax
Hi @Adidas ,
See if these help you
https://curbal.com/blog/joining-table-in-power-bi-with-power-query-and-dax
https://www.tutorialgateway.org/joins-in-power-bi/
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |