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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Count occurrences ????

I have a table which contains all possible values eg: 

moustafa67_1-1636975083280.png

And I have another table : 

moustafa67_2-1636975107964.png

 

I need to count how often each value appears like this: 

moustafa67_3-1636975144910.png

But how do I realize this ?!?!

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

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

 

Picture1.png

 

Occurrences: =
VAR currentvalue =
MAX ( 'Values'[Values] )
RETURN
IF (
HASONEVALUE ( 'Values'[Values] ),
CALCULATE ( COUNTROWS ( Data ), FILTER ( Data, Data[Column1] = currentvalue ) )
+ CALCULATE ( COUNTROWS ( Data ), FILTER ( Data, Data[Column2] = currentvalue ) )
+ CALCULATE ( COUNTROWS ( Data ), FILTER ( Data, Data[Column3] = currentvalue ) )
)

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.


Click here to visit my LinkedIn page

View solution in original post

Hi,

please check the attached pbix file.

 

Picture1.png

 


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.


Click here to visit my LinkedIn page

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi,

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

 

Picture1.png

 

Occurrences: =
VAR currentvalue =
MAX ( 'Values'[Values] )
RETURN
IF (
HASONEVALUE ( 'Values'[Values] ),
CALCULATE ( COUNTROWS ( Data ), FILTER ( Data, Data[Column1] = currentvalue ) )
+ CALCULATE ( COUNTROWS ( Data ), FILTER ( Data, Data[Column2] = currentvalue ) )
+ CALCULATE ( COUNTROWS ( Data ), FILTER ( Data, Data[Column3] = currentvalue ) )
)

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.


Click here to visit my LinkedIn page

Anonymous
Not applicable

@Jihwan_Kim How can I get the total?

Hi,

please check the attached pbix file.

 

Picture1.png

 


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.


Click here to visit my LinkedIn page

Anonymous
Not applicable

Thank you so much !

Anonymous
Not applicable

You're a hero

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.