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.
Hi All,
Need help in creating a DAX. I have three tables. Date, Table A, Table B.
We need to find out the subscriber who has left from two table. Now we count the subsciber id if the close date is is not null. In this scenario the subscriber must be in Table A (So count the ID in Table A) and then look when they have left which can either come from Table A or Table B. So we counted
measure1=Count(Table A ID), userelationship datekey, table A clodedate key= 4
Measure2=Count(Table A ID), userelationship datekey, table B clodedate key= 4
So IN this case it becomes =4+4=8, however it should be 4 only.
We want to count the ID in Table which has either a close date in A or B.
In table A we have 4 of them.
Hello @bijuphilipose ,
From what I've got from your explanation your task is to get number of subscribers from table A that have close date either in table A or table B.
1. Create a relation between your 2 tables on Subscriber ID column.
2. Your measure:
#Subscribers =
COUNTX(
FILTER(
TableA,
NOT(ISBLANK(TableA[Close Date])) || NOT(ISBLANK(RELATED(TableB[Close Date])))
),
TableA[S_ID]
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Thanks! The issue is the dates are present in both the tables sometimes. I am linking my date dim to the close date of the Table A and close date of Table B and Table A and B is alo joined on sub id's. As we need this data to be shown monthly the date slicer is required. Now I need to llok at the sub id in Table and and find if there is a close dat in A or B. So if a date is present in table A then I should ignore the date in Table B. I hope not sounding unfair in explaining it.
It does not matter whether the dates are present in 2 tables or in one of them. If the date is present in one table or in both tables, it will still count as one. || - OR operator.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
@bijuphilipose , You need to have a common subscribe table , with that you can run a formula like
refer: https://www.youtube.com/watch?v=Bkf35Roman8
countx(filter(summarize(Suscriber, Suscriber[Suscriber], "_1", Count(Table1[Close Date])+0, "_2", Count(Table2[Close Date])+0), _1 >0 && _2>0),[Suscriber])
Thanks for reply!
IN my case I only want the id from Table A and there close dates from A or B. The table B can have more ID in there (a common table does not works). Now, I need to check any ID in Table A has a close date in A or B. My date table is linked to closed date of Table A.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |