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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I am trying to create a Column that only show the value if is duplicate on the first line. rather than repeating the distinc count on every single row.. I added the earlier on ID and also on RowNumber but get same results.
| RowNumber | ID | DistinctCount | Show only Once |
| 1 | 5343 | 2 | 2 |
| 3 | 5343 | 2 | |
| 4 | 4333 | 2 | 2 |
| 5 | 4333 | 2 | |
| 6 | 1333 | 1 | 1 |
Solved! Go to Solution.
There might be a faster way to do this, but this builds each step one at a time @Anonymous
First Distinct =
VAR varCurrentID = [ID]
VAR varCurrentRow = 'DataTable'[RowNumber]
VAR varFirstRow =
MINX(
FILTER(
'DataTable',
'DataTable'[ID] = varCurrentID
),
'DataTable'[RowNumber]
)
VAR varCounts =
COUNTX(
FILTER(
'DataTable',
'DataTable'[ID] = varCurrentID
),
'DataTable'[ID]
)
RETURN
IF(
varCurrentRow = varFirstRow,
varCounts,
BLANK()
)
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThere might be a faster way to do this, but this builds each step one at a time @Anonymous
First Distinct =
VAR varCurrentID = [ID]
VAR varCurrentRow = 'DataTable'[RowNumber]
VAR varFirstRow =
MINX(
FILTER(
'DataTable',
'DataTable'[ID] = varCurrentID
),
'DataTable'[RowNumber]
)
VAR varCounts =
COUNTX(
FILTER(
'DataTable',
'DataTable'[ID] = varCurrentID
),
'DataTable'[ID]
)
RETURN
IF(
varCurrentRow = varFirstRow,
varCounts,
BLANK()
)
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThank You for quick response...Edhans๐
Glad to help @Anonymous
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCheck out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!