Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Count values from multiple fields

Dear Experts,

I want to count values in multiple fields as shown in below image -

bhuprakashs_0-1597922492098.png

 

I want result like below -

 

Entry Planted NameNo of Count
P35504
M202011
M20118

 

Request you to help me how to achieve this in powerbi.

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Dear @bhuprakashs

I have your problem solved, here it is,

But let me mention, you'll need an index table, so that you can relate it to the unpivoted column called as values.
So that counting values other than the index to add in the rows field.

I hope this solves your problem.

I expect a "like in both of my post", will motivate me to help more friends like you.
and if this post brought answers to your questions please accept this post as a solution

If there are further doubts please let me know.

Best regards

Thakur Sujit

View solution in original post

Dear @bhuprakashs ,
happy to know , if you have any doubt you can always ask ,
just drop me a message here in community message box ,
ill be happy to help.

Regards
Sujit Thakur

View solution in original post

11 REPLIES 11
Sujit_Thakur
Solution Sage
Solution Sage

Dear @Anonymous ,
I got your question 
https://drive.google.com/file/d/1msJ8bR2IuJfercsDW6D3etuQ70OjHvJZ/view?usp=sharing


go to this link download , it is yur solutiuon 

steps are 
1) You must have a index table with Distinct name 
2)  go in transform data , using home option in your Head ribbon , after going in transform , you will see your table
3)Now select all columns you want to count , then go in transform tab click unpivot selected columns 

soluchan.JPG
3)Then close and apply .

4) Make sure your name from index has relation with values after unpivoting .(using model ribbon on LHS)

5) then just put
solution 2.JPG

Done !!!



Please dont forget to give kudos ,
If it help you reach your solution please accept this post as solution .
if any further doubt please let me know ill be more than happy to help

Thanks 
Sujit 

Anonymous
Not applicable

HI @Sujit_Thakur ,

My desired output is bit different. Attaching the dummy data and desired output in excel.

Kindly have a look and let me know in case of any query.

https://drive.google.com/file/d/1KAVuHoTz2TeEsnyCxBeipLsr2YNbgw7-/view?usp=sharing

Dear @bhuprakashs

I have your problem solved, here it is,

But let me mention, you'll need an index table, so that you can relate it to the unpivoted column called as values.
So that counting values other than the index to add in the rows field.

I hope this solves your problem.

I expect a "like in both of my post", will motivate me to help more friends like you.
and if this post brought answers to your questions please accept this post as a solution

If there are further doubts please let me know.

Best regards

Thakur Sujit

Anonymous
Not applicable

Thank you @Sujit_Thakur for your help.

I have done it. I just did unpivoting and then grouped it and it solved my problem.

Thank you all once again 🙂

Dear @bhuprakashs ,
happy to know , if you have any doubt you can always ask ,
just drop me a message here in community message box ,
ill be happy to help.

Regards
Sujit Thakur

Anonymous
Not applicable

Dear All,

Thanks for your quick revert on my query.

Let me try it my end and come back to you as it's looking bit difficult for me but I will try it.

Regards,

Bhu

@Anonymous 

What you can do is download file from drive link which I shared in my last post it will be a quick reference

amitchandak
Super User
Super User

@Anonymous , better to unpivot

https://radacad.com/pivot-and-unpivot-with-power-bi

Or create a join it with a common dimension Entry planned name, all 4, With one active and another inactive. Create 4 count measure with userelation and them

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi

 

How to combine value and create table. example in pbix . you have to do for four column

https://www.dropbox.com/s/op9lb78w9utdonz/Distinct%20from%20two%20Tables.pbix?dl=0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Sujit_Thakur
Solution Sage
Solution Sage

@Anonymous  ,
Can you let me know that Entry planted name are different columns so do you want such results ??

Name   entry planted 1     entry planted 2      entry planted 3

A                 12                           14                            15 
B                   3                             12                          12             
C                    23                            1                              123



Let me know , so that i could help

 

mahoneypat
Microsoft Employee
Microsoft Employee

Your data should be unpivoted in the query editor (highlight the columns not shown, right click and choose Unpivot Other Columns).  Having all your data in a single column will make your analysis much easier (you would still have the Name # in the "Attribute" column for other analysis).

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Greg_Deckler
Community Champion
Community Champion

@Anonymous - You can UNION your columns together and then FILTER out the values that match your entry plant name and then COUNTROWS the filtered set.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.