Forum Discussion

leoleoniids's avatar
leoleoniids
Frequent Visitor
5 years ago
Solved

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?

 

 

  • 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.

     

     

    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

2 Replies

  • 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.

     

     

    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

    • leoleoniids's avatar
      leoleoniids
      Frequent Visitor

      Hello Jihwan,

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