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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
leoleoniids
Frequent Visitor

Distinctcount based on measure values

Hi!

 

I am looking for solution to make a measure what in excel would be COUNTIFS.

 

How could I get card visual with counted rows what I can filter, but cannot make a simple number of rows.

 

I mean It could be something like this:

I have two table

  • PRODUCT
    • Product_id
    • admin_creator_id
  • IMG
    • Product_id
    • img_link

I need to count how many products is created by some admin and contains more the 25pic.

 

in sample is two rows with products that contain more then 25pic. So how could I get that number rows?

 

 

Screenshot 2021-05-11 at 22.17.24.jpgScreenshot 2021-05-11 at 22.17.30.jpg

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @leoleoniids 

I tried to create a sample pbix file based on the explanation.

Please check the below picture and the sample pbix file's link down below.

 

Picture1.png

 

Img Count =
VAR newtable =
SUMMARIZE (
'Product',
'Product'[Product_id],
'Product'[admin_creator_id],
"@countimg", COUNTROWS ( FILTER ( img, COUNTROWS ( img ) >= 25 ) )
)
RETURN
SUMX ( newtable, [@countimg] )
 
 
 

Hi, My name is Jihwan Kim.


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


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

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


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @leoleoniids 

I tried to create a sample pbix file based on the explanation.

Please check the below picture and the sample pbix file's link down below.

 

Picture1.png

 

Img Count =
VAR newtable =
SUMMARIZE (
'Product',
'Product'[Product_id],
'Product'[admin_creator_id],
"@countimg", COUNTROWS ( FILTER ( img, COUNTROWS ( img ) >= 25 ) )
)
RETURN
SUMX ( newtable, [@countimg] )
 
 
 

Hi, My name is Jihwan Kim.


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


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

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


Hello Jihwan,

Thank you. I have changed SUMX to COUNTAX to count a number of products that contains more the 25pic

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors