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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Good evening to all. I have a problem with powerbi that I can't solve: I have the following data stored there (for simplicity, I have voluntarily reduced the size of the table):
id: the id of a person. Here we have three persons
Name: represents an activity performed by a person. Here we have only two activities: activity 1 and activity 2
Value: the value transmitted by the person.
Date: the date and time of transmission.
As you can see, a person can send several data in one day, at different hours. Now I want a table in powerbi that represents the data as follows
For the latter, I wanted to make a DATEDIFF(Donnee[Date]-Donnee[last], DAY) +1. But I have the following error: It is impossible to determine a unique value for the "Date" column in the "Data" table. This can happen when a measurement formula refers to a column that contains many values, without specifying an aggregation such as min, max, count or sum to get a unique result.
Solved! Go to Solution.
You need an aggregation for each column in the measure. For example,
DATEDIFF ( MIN ( Donnee[Date] ), MAX ( Donnee[Date] ), DAY ) + 1
The reason for this is that without row context (like you have in a calculated column), Donee[Date] refers to a column rather than a single value in that column. Even if there is only a single unique value in the local filter context, you still need to use SUM/MIN/MAX/VALUES/AVERAGE/etc.
You need an aggregation for each column in the measure. For example,
DATEDIFF ( MIN ( Donnee[Date] ), MAX ( Donnee[Date] ), DAY ) + 1
The reason for this is that without row context (like you have in a calculated column), Donee[Date] refers to a column rather than a single value in that column. Even if there is only a single unique value in the local filter context, you still need to use SUM/MIN/MAX/VALUES/AVERAGE/etc.