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,
I have two tables: 'Lead' and "Contact' with relation many to many using keys Lead[ParentContactId] and Contact[ContactId]. I want to create a measure in leads table to count number of matching contact records for each lead based on few criteria:
Then I want to split this count equally for each matching lead, so if there are two contact records meeting the criteria for particular lead and two leads with the same 'ParentContactId' then show 1 for each lead.
Each 'Contact' record represents one purchase so that is why contact ids are duplicated. I can group them to get unique records and many to one relation between the tables. I tried it but I have problem with referencing columns that have been grouped as table structured column.
I got to that point and got stuck:
Conversions =
CALCULATE(
COUNTROWS(Contact),
FILTER(
ALL(Contact),
COUNTROWS(
FILTER(
RELATEDTABLE(Contact),
Contact[ContractDate] >= Lead[CreatedOn] &&
Contact[ContractDate] <= Lead[CreatedOn] + 90
)
) > 0
)
)
I am getting an error: "A single value for column 'CreatedOn' in table 'Lead' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result." probably because of many to many relation.
I would be very grateful if someone would like to guide me on how to solve this
Solved! Go to Solution.
Hi @pawelk3 ,
It seems that what you are trying to create is a measure, please update the formula of measure[Conversions] as below. Later check if it can return your expected result...
Conversions =
VAR _seldate =
SELECTEDVALUE ( Lead[CreatedOn] )
RETURN
CALCULATE (
COUNT ( Contact[ContactId] ),
FILTER (
Contact,
Contact[ContractDate] >= _seldate
&& Contact[ContractDate] <= _seldate + 90
)
)
In addition, you can review the following blog to know the common DAX errors...
DAX error messages in Power BI
If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format, your treemap Fields settings and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @pawelk3 ,
It seems that what you are trying to create is a measure, please update the formula of measure[Conversions] as below. Later check if it can return your expected result...
Conversions =
VAR _seldate =
SELECTEDVALUE ( Lead[CreatedOn] )
RETURN
CALCULATE (
COUNT ( Contact[ContactId] ),
FILTER (
Contact,
Contact[ContractDate] >= _seldate
&& Contact[ContractDate] <= _seldate + 90
)
)
In addition, you can review the following blog to know the common DAX errors...
DAX error messages in Power BI
If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format, your treemap Fields settings and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 44 | |
| 40 | |
| 29 | |
| 19 |
| User | Count |
|---|---|
| 202 | |
| 130 | |
| 102 | |
| 72 | |
| 55 |