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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Experts
I have two tables as shown below (made up data) Table B is the FACT table and Table A has Complaint Dates and ID's. The two tables are linked via the ID column.
Here is the scenario. If there is a ID match between Table B and A then
1. Find the most current date for ID 1 its 26/09/2020 and for ID 4 its 16/09/2020. Then i want to be able to subtract this from the following dAX measure
Solved! Go to Solution.
Hi @Anonymous ,
You can create a measure as below:
DDM Activated =
CALCULATE (
DISTINCTCOUNT ( 'B'[ID] ),
FILTER ( 'B', 'B'[ID] IN VALUES ( 'A'[ID] ) && 'B'[DEPT] IN { "A", "B", "C" } )
)Best Regards
Rena
@Anonymous First, I would avoid many-to-many relationships. You should create a bridge table of unique values for ID and put that between the two tables.
Second, I do not understand the finding of the last date thing as I do not understand why that matters in the calculation you are proposing.
Third, you don't need CALCULATE.
Try this:
DDM Activated =
COUNTROWS(FILTER('Table (28a)','Table (28a)'[Dept] IN {"A","B","C"})) -
COUNTROWS(FILTER('Table (28a)','Table (28a)'[ID] IN SELECTCOLUMNS('Table (28)',"ID",[ID])))
PBIX is attached below sig.
Thanks Greg the gods have spoken ill listen. Always appreciate the feedback. Let me test.
Hi @Anonymous ,
You can create a measure as below:
DDM Activated =
CALCULATE (
DISTINCTCOUNT ( 'B'[ID] ),
FILTER ( 'B', 'B'[ID] IN VALUES ( 'A'[ID] ) && 'B'[DEPT] IN { "A", "B", "C" } )
)Best Regards
Rena
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |