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
Lobo1908
Helper I
Helper I

Percentage of total using lookup table

Hi, 

 

I'm trying to calculate the percentage of total using a lookup table. 

 

The lookup table called 'Codes_Lookup' contains  two columns:

[Codes] - containing the list of codes 

[Desc] - containing the description of those codes 

 

The data table called 'Data' contains several columns, one of them is called [Error Codes] and contains codes that were used for a specific unit. each cell contains only one code. 

 

The 'Codes lookup' column [Codes] has a one to many relationship with the [Error Codes] column form the 'Data' table, its a one way relationship.  

 

I'm trying to display the percentage of tottal of codes used in the data tables:

For this I've created the following metrics:

 

Count = COUNTROWS('Data')

Count All = CALCULATE([Count],ALL(Data[Error Codes]))

Count (%) = DIVIDE([Count],[Count All])
 
When I put those metrics as values in matrix visiuals and the Codes as rows, this is not working. 
Count and Count all are the same numbers caounting occurences for specific Code. 
Count (%) in this case is alwwyas 100%
 
When I put the [Error Codes] form the 'Data' table instead of [Codes] from the lookup tavel   into rows it works fine but I'm not able to add descritption or filter it by additonal columns I'm planning to add to the lookup table. 
 
could someone support with this issue. 
 
 
 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Lobo1908 you need to change your measure, and assuming code lookup table has relationship with data table

 

Count All = CALCULATE([Count],ALL(CodeLookUpTable[Codes]))


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

1 REPLY 1
parry2k
Super User
Super User

@Lobo1908 you need to change your measure, and assuming code lookup table has relationship with data table

 

Count All = CALCULATE([Count],ALL(CodeLookUpTable[Codes]))


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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors