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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to get total uses of dozens of document codes?

I have several years' worth of data like the image below. I need to count the total uses of the alphabetic codes in the second column, like ENG, RALB, and SQP. I tried this measure:

CodeCount = DISTINCTCOUNT('Done Data Files'[Group])

It gives me "48", which is the number of such codes in the 2019 data. ("Group" is a column not shown in the image that keeps only the content to the left of the hyphen.)

 

I need numbers like ENG = 23. I can find that number by filtering and counting, but I'm stumped on getting it in a column or measure using DAX. 

data_csv-sample.jpg

I'm very new to PowerBI; I've finished an excellent course online, but figuring out how to parse the data I need is a steep climb.

2 REPLIES 2
Anonymous
Not applicable

Thanks, Ahmedx! I have the column shown below in the data view, as column "Group."

The DAX for that column is as follows:

Group = IF('Done Data Files'[Forms]="Form",(LEFT('Done Data Files'[DocNo],SEARCH("-",'Done Data Files'[DocNo],,LEN('Done Data Files'[DocNo])+1)-1)),"Non-Form")

My attempts at using COUNT to get the totals of each result in the Group column have failed. Is this something I can only get in visualizations? I was also thinking a separate data table might work to give me this count.

GroupColumnIncluded.jpg

 

 

Ahmedx
Super User
Super User

you need to create an additional column like this, and then it will be easier for you to calculate the COUNT
Screen Capture #1106.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors