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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Janoshz
Frequent Visitor

Counting occurrence by two column values

Hello,

I have two columns by which I needto calculate occurrences.

 

Column A has 5 values (text) and COL B can have several (text)

 

eg.


COL A         COL B

1                    XXX1

3                    XXX1

3                    XXX1       

4                    XXX2

5                    XXX3

5                    XXX3

2                    XXX4

1                    XXX2

 

For example here I'd need to count COL A values 3 and COL B XXX1 to be 2.

Thanks 🙂

1 ACCEPTED SOLUTION

Hi @Janoshz 

 

You can put the measure in a table visual along with COL A and COL B. In this way you will see the occurrences for every pair of COL A and COL B values. Remember to select Don't summarize for COL A and COL B. 

vjingzhang_0-1648541770679.png

 

If this is not what you want, what is your expected output should be like?

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached file.

 

Picture1.png

 

counting measure: = 
COUNTROWS( Data )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi,

This could work, but there are hundreds of diffrent values in col B so I'd like to do this with DAX.


Hi @Janoshz 

 

You can put the measure in a table visual along with COL A and COL B. In this way you will see the occurrences for every pair of COL A and COL B values. Remember to select Don't summarize for COL A and COL B. 

vjingzhang_0-1648541770679.png

 

If this is not what you want, what is your expected output should be like?

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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