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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
juncco888
Advocate I
Advocate I

New Column with count based on Values from two columns

Hi Everyone,

 

I am hoping this is simple for someone here but I have been having a devil of a time getting the result I need.

 

Here is my table  

Screenshot 2023-08-29 160717.png

I want a new column that I will call Nr in EG that counts the number of distinct schools numbers within an enrollmen group so the results would look like this

 

SchNrEnrollment GroupsNr in EG
15<1001
110201-3502
123>3502
134100-2001
163201-3502
167>3502

 

 

I have measures that give me this count for each enrollment group already but I need a single column that tells me the total number of schools so next to a school i can see the number of schools that are in the same enrolment group.

 

Any assitance would be greatly appreciated.

 

Thanks

 

Kyle

 

Edit:  Corrected expected output

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@juncco888 add column using following DAX:

 

Count = CALCULATE ( COUNT ( School[SchNr] ), ALLEXCEPT ( School, School[Enrollment Groups] ) )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@juncco888 add column using following DAX:

 

Count = CALCULATE ( COUNT ( School[SchNr] ), ALLEXCEPT ( School, School[Enrollment Groups] ) )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks so much....  AllExcept is what I was missing.....   I am going to read up on AllExcept because my guess is it will solve many problems for me.  I really appreciate it....   

parry2k
Super User
Super User

@juncco888 isn't the last row the value supposed to be 2?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Yes...  it is ...   I will corrrect that,...  Thanks for pointing that out

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.