cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Lobo1908
Frequent Visitor

Count occurrences based on lookup table and a category in it

Hi, 

 

I've got a table with bunch of codes. 

Now I need a measure to count those codes but only the one that have a specific condition which is assigned to each code in a lookup table. 

 

My data table looks like that. 

Code 
A1
B1
C1
A1
B1
C1
A1
B1
C1
A1
A1
D1
C1
C1
A1

D1

My lookup table like this

 

CodeCondition 
A1New
B1New
C1Old
D1

Old

 

And for example I want to count only the one that have 'New' as Condition in the loopu table 

 so the results hsoulkd be:

A1 - 6

B1 - 3

 

Could nayone support please 

 

2 REPLIES 2
HotChilli
Super User
Super User

create a relationship between lookup table and the main table (on code).

Drag Code field from the lookup on to a table visual, drag code from the main table on to the same visual.  Make the second one a Count aggregation.

Put Condition from the lookup table in a slicer

Hi @HotChilli ,

I know how to present those values in a table or matrix. 

I require a measure for further calculations

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors