Forum Discussion
Summarize Table and Remove Duplicates
- 6 years ago
Try distinct(Table)
or in case summarize group by what you distinct first and take measure with rename post that.
You can use table inplace of summarize
countrows(
SUMMARIZE('_AELaborEdit - Clock In Date',
'_AELaborEdit - Clock In Date'[ClockInDate],
'_AELaborEdit - Clock In Date'[Job],
'_AELaborEdit - Clock In Date'[Operation],
"Operations Count",
COUNTROWS('_AELaborEdit - Clock In Date'))or
countx(
SUMMARIZE('_AELaborEdit - Clock In Date',
'_AELaborEdit - Clock In Date'[ClockInDate],
'_AELaborEdit - Clock In Date'[Job],
'_AELaborEdit - Clock In Date'[Operation],
"Operations Count",
COUNTROWS('_AELaborEdit - Clock In Date')
)
), [Operations Count])https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Try distinct(Table)
or in case summarize group by what you distinct first and take measure with rename post that.
You can use table inplace of summarize
countrows(
SUMMARIZE('_AELaborEdit - Clock In Date',
'_AELaborEdit - Clock In Date'[ClockInDate],
'_AELaborEdit - Clock In Date'[Job],
'_AELaborEdit - Clock In Date'[Operation],
"Operations Count",
COUNTROWS('_AELaborEdit - Clock In Date'))
or
countx(
SUMMARIZE('_AELaborEdit - Clock In Date',
'_AELaborEdit - Clock In Date'[ClockInDate],
'_AELaborEdit - Clock In Date'[Job],
'_AELaborEdit - Clock In Date'[Operation],
"Operations Count",
COUNTROWS('_AELaborEdit - Clock In Date')
)
), [Operations Count])
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
- shippen706 years ago
Helper I
Thanks for the reply. When I try to add the COUNTROWS before the Summarize I get an error:
"The expression specified in the query is not a valid table expression"
When I try to use COUNTX it will not allow me to reference back to the "Operations Count" Coulmn created in the summarize.
Any additional thoughts?- mahoneypat6 years ago
Microsoft Employee
I put the expression provided by amitchandak into DaxFormatter.com. It was just missing the last ")".
NewMeasure =
COUNTROWS (
SUMMARIZE (
'_AELaborEdit - Clock In Date',
'_AELaborEdit - Clock In Date'[ClockInDate],
'_AELaborEdit - Clock In Date'[Job],
'_AELaborEdit - Clock In Date'[Operation],
"Operations Count", COUNTROWS ( '_AELaborEdit - Clock In Date' )
)
)Regards,
Pat
- shippen706 years ago
Helper I
I had corrected the braket issue but still get the same result. Based on @amitchandak input to countrows again I just created a second Measure to count the table rows again. I achived what I was trying to. Thanks