Forum Discussion
SUM FREQUENCY from Data Table to Report Table (DAX Required)
Hi,
I would like to get the unique count based on the data table (item and status) according to the comments in report table.
In Excel I am applying the following formula F2=SUM((FREQUENCY(MATCH(A$2:$A$19&"",$A$1:$A$19&"",0)*($B$2:$B$19=$D3),ROW($A$2:$A$19))>0)+0)-1 in order to get the my final result.
In data table, The item against updated the status in data table. The same item can not be two different comments. The item are repeated as well..
DATA:
| ITEM | STATUS |
| 234 | MATCHED |
| 234 | MATCHED |
| 234 | MATCHED |
| 234 | MATCHED |
| 234 | MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 235 | NOT MATCHED |
| 1234 | MATCHED |
| 7890 | NOT MATCHED |
| 67890 | NOT MATCHED |
REPORT TABLE:
| COMMENTS | DESIRED RESULT |
| MATCHED | 2 |
| NOT MATCHED | 3 |
- Anonymous5 years ago
Hi Saxon10 ,
Check the formula.
Column = CALCULATE(DISTINCTCOUNT('Table'[ITEM]),FILTER('Table','Table (2)'[comments]='Table'[STATUS]))Best Regards,
Jay
12 Replies
- parry2k
Super User
Saxon10 add following measure and in the visual, use Status and this measure.
Match Count = DISTINCTCOUNT ( Match[ITEM] )Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- Saxon10
Post Prodigy
Hi,
Your soltion not working. Can you please share your output.
I want DAX solutions. I don't want measue option.
- Saxon10
Post Prodigy
thanks for your quick reply. Sorry for the inconvenience. I mean by calculate column.
I want calculate column in my report table based on the data table {Item and status}.
- parry2k
Super User
Saxon10 try this as a column
Match Count Column = CALCULATE ( DISTINCTCOUNT ( Match[ITEM] ), ALLEXCEPT ( Match, Match[STATUS] ) )Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- Saxon10
Post Prodigy
Thanks for your reply again. Now I got the unique count in my data table according to the item and status. I want to know no of matched and not matched in my report table.
I want new calculate column in my report table.
- parry2k
Super User
Saxon10 you already have a count column why you need another one. Sorry to say but your requirement is all over the place.
Just use table visual, use status and count column in the visual, and make sure don't aggregate count column otherwise it will show the sum.
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
I still don't understand the purpose of this adding as a column.
- Saxon10
Post Prodigy
Sorry for the late response.
The reason I want calculated column in report table for multiple legends in one chart. I already build lot column in report table so I would like to add one more column which is unique count according to the comments.
can you please advise.
- Ashish_Mathur
Super User
Hi,
To your Table, drag the status column and write this measure
Measure = distinctcount(data[item])
Hope this helps.
- AnonymousNot applicable
Hi Saxon10 ,
Check the formula.
Column = CALCULATE(DISTINCTCOUNT('Table'[ITEM]),FILTER('Table','Table (2)'[comments]='Table'[STATUS]))Best Regards,
Jay
- Saxon10
Post Prodigy
thank you so much for your help. This is I am looking for it. Its very simple and awesome.