Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |