Forum Discussion
DAX to count rows with same value for Column A for a value in column B
- 8 years ago
You may refer to the measures below.
Measure = COUNTROWS ( FILTER ( VALUES ( Table1[Id] ), CALCULATE ( COUNT ( Table1[Email] ) > DISTINCTCOUNT ( Table1[Email] ) ) ) )Measure 2 = COUNTROWS ( FILTER ( VALUES ( Table1[Id] ), CALCULATE ( DISTINCTCOUNT ( Table1[Email] ) > 1 ) ) )
Mariusz i am not sure how we create table out of query
- Anonymous7 years agoNot applicable
Mariusz Thank you for the quick reply. Table is created and relation also build between two columns. Between new table [id_column] and direct query table [id_column]. As per your instruction I have created another mesure also that counts rows for direct query table. But i didn't understand how to achive the result i wanted like i posted in my question.
Here is the result I am getting after used values from dynamic table created.
please find the sample PowerBi file (GoogleDrive). I have created this powerbi file using exact sample data i have provided in my quesion and applied your solution on that. If you can work on that file and send me back. That would be really helpful.- Mariusz7 years ago
Community Champion
Hi Anonymous
Sorry, missed CALCULATE()
Table = ADDCOLUMNS( DISTINCT( DirectQuery[ID_ColumnID_001]), "Repeated time", FORMAT( CALCULATE( COUNTROWS( DirectQuery ) ), "" ) & " Times" )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.- Mariusz7 years ago
Community Champion
Hi Anonymous
and - 1 to start @ 0 Times.
Table = ADDCOLUMNS( DISTINCT( DirectQuery[ID_ColumnID_001] ), "Repeated time", FORMAT( CALCULATE( COUNTROWS( DirectQuery ) ) -1, "" ) & " Times" )