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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dmyers1000
Regular Visitor

Count of a Measure

Hello Everyone,

 

I am new to Power Bi, I created a measure that counts IDs per sales rep, however, what I am looking for is a secondary measure that will count the cels per day of that table that are less than 3 however it does not seem to count the zeros.

Any help would be appreciated!

 

Measure: 

CALCULATE(
DISTINCTCOUNT(vbpm_opportunity[Id]))+0

 

 

Table

dmyers1000_0-1612807732635.png

 

The result I am trying to achieve is to count all red cels which are less than 3

 
 
2/2/20212/3/20212/4/20212/5/20212/6/20212/7/20212/8/2021
2113313
 
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@dmyers1000 I missed pbix file, here it is :

 

CountX = SUMX ( SUMMARIZE( ALLSELECTED ( data[OwnerId] ), data[OwnerId],  "@Count", IF ( [CountID] < 3, 1, 0 ) ), [@Count] )

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@dmyers1000 sorry for the delay, I missed the attachment to get back on it. Cheers!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@dmyers1000 I missed pbix file, here it is :

 

CountX = SUMX ( SUMMARIZE( ALLSELECTED ( data[OwnerId] ), data[OwnerId],  "@Count", IF ( [CountID] < 3, 1, 0 ) ), [@Count] )

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k This solution works great!! thank you so much!

v-xulin-mstf
Community Support
Community Support

Hi @dmyers1000,

 

Try measure as:

Measure = 
CALCULATE(
    DISTINCTCOUNT(vbpm_opportunity[Id]),
    FILTER(
        Table,
        Table[cels]<3 && Table[cels]>0 && Table[Date]=MAX(Table[Date])
        )))

 

Best Regards,

Link

Hi @v-xulin-mstf,

 

Thanks! however it does not seem to give me results, let me know if I am interpreting this wrong.

 

dmyers1000_0-1612976398928.png

 

parry2k
Super User
Super User

@dmyers1000 It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sure thing, below the link for pbix file, in the visual you will see an 2 tables, the table below (image) is the expected result which is counting the red cels from the table above. The issue is that I am not able to count zeros which are blanks.

 

PBIX FILE 

parry2k
Super User
Super User

@dmyers1000 try this

 

Count Less Than 3 = 
COUNTX ( VALUES ( Table[Date column] ), IF ( [Your Measure] < 3, 1 ) )

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks however does not seem to solve the issue any other ideas?

 

dmyers1000_0-1612811313158.png

 

Helpful resources

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