Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, I am very new to BI. I am trying to get the sum of column X by filtering the distinct rows based on the Column A.
My Data looks like below
RecID | BatchID | RecordCount | Remarks |
201611280350010172 | 092860 | 2 | ABC |
201611280350010172 | 092860 | 2 | llsjd |
201611280350010172 | 092860 | 2 | fgfd |
201611280350010172 | 092860 | 2 | dfg |
201611280350010172 | 092860 | 2 | dfg |
201611280350230000 | 935613 | 3 | ythe |
201611280350230000 | 935613 | 3 | shyht |
201611280350230000 | 935613 | 3 | sdr |
201611280350230000 | 935613 | 3 | utt |
201611280350202000 | 057808 | 1 | ghk |
201611280350202000 | 057808 | 1 | sdew |
201611280350202000 | 057808 | 1 | dfgj |
201611280350202000 | 057808 | 1 | sdfr |
My requirement is to take the distinct rows based on column RecID and sum the values in column RecordCount.
so my expected value is 2+3+1 = 6.
Please advise how I can achieve this.
Solved! Go to Solution.
Hi @kiran85
You can create a new summary table using this DAX. I've assumed your main table is called Table1.
You can create SUM based measures on this table that will give you the result of 6
Summary Table = SUMMARIZE( 'Table1', Table1[RecID], "RecordCount",MAX('Table1'[RecordCount]) )
Hi @kiran85
You can create a new summary table using this DAX. I've assumed your main table is called Table1.
You can create SUM based measures on this table that will give you the result of 6
Summary Table = SUMMARIZE( 'Table1', Table1[RecID], "RecordCount",MAX('Table1'[RecordCount]) )
@Phil_Seamark wrote:Hi @kiran85
You can create a new summary table using this DAX. I've assumed your main table is called Table1.
You can create SUM based measures on this table that will give you the result of 6
Summary Table = SUMMARIZE( 'Table1', Table1[RecID], "RecordCount",MAX('Table1'[RecordCount]) )
Hi @Phil_Seamark. Thanks for your response. Unfortunately I am receiving an error as "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
Thanks Phil
For Phil solution you have to press the New Table button and then enter the formula!
Here's an alternative using the Query Editor's Group By feature...
Both methods will give you the same result!
Thanks Sean
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |