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.
DTA | ID | VALUE |
2024-07-01 | 12345 | 8 |
2024-07-01 | 12345 | 8 |
2024-07-01 | 12347 | 8 |
I need to create a measurement that makes me output Value= 8 for ID=12345 when the DTA is the same.
I Don't want sum but distinct
Solved! Go to Solution.
Hi @Cocrodile ,
I create a table as you mentioned.
Then I create a calculated column and here is the DAX code.
Column =
VAR CurrentRowDTA = 'Table'[DTA]
VAR CurrentRowID = 'Table'[ID]
VAR CurrentRowVALUE = 'Table'[VALUE]
RETURN
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[DTA] = CurrentRowDTA
&& 'Table'[ID] = CurrentRowID
&& 'Table'[VALUE] = CurrentRowVALUE
)
) > 1,
1,
0
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Cocrodile ,
I create a table as you mentioned.
Then I create a calculated column and here is the DAX code.
Column =
VAR CurrentRowDTA = 'Table'[DTA]
VAR CurrentRowID = 'Table'[ID]
VAR CurrentRowVALUE = 'Table'[VALUE]
RETURN
IF (
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[DTA] = CurrentRowDTA
&& 'Table'[ID] = CurrentRowID
&& 'Table'[VALUE] = CurrentRowVALUE
)
) > 1,
1,
0
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Cocrodile ,
There are many ways to achive your required outputs and one of them is to use the dax formula like below to create a calculated table which doesn't contain duplicate rows:
Table 2 = calculatetable(distinct('Table'))
I attach a pbix file as an example.
Best regards,
must return all the results with the max value, by necessity I need all the rows because I have other information
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |