cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
astano05
Frequent Visitor

Distinct Row Count with filter for Transaction Amount

I'm looking to get the distinct count of rows when the transaction amount is below a certain value. It also will not let me place a visual level filter on the card of the count.

 

I try 

CALCULATE(DISTINCTCOUNT('Transaction History'[ORDER_NUMBER]),[Transaction Amount]<500) but i get this error: "A function "Calculate" has been used in a True/False expression that is used as a table filter expression. This is not allowed."
 
I also tried 
Order under 500 = countrows(DISTINCT(SELECTCOLUMNS('Transaction History',"under 500",[Transaction Amount]<500))); but it gives me an incorrect count. 
 
I have a table as below:
Order NumbercustomerSum of Order Amount
1A1000
2A250
3A100
4A600
5B200
6B1000

I want a card to show the number of orders below $500 (3). 

1 ACCEPTED SOLUTION
amitchandak
Super User IV
Super User IV

@astano05 , Assuming Sum of Order Amount is a measure

Create a new measure

countx(filter(values('Transaction History'[ORDER_NUMBER]), [Sum of Order Amount]<500),[ORDER_NUMBER])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
amitchandak
Super User IV
Super User IV

@astano05 , Assuming Sum of Order Amount is a measure

Create a new measure

countx(filter(values('Transaction History'[ORDER_NUMBER]), [Sum of Order Amount]<500),[ORDER_NUMBER])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Yes this works perfectly! Thank you

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors