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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Count based on revenue amount

I need 3 measure like >5, <5, result

basically we need to create >5 how many distinct count of desc based on amount criteria, suggest

example table:

DescAmount
A10
B4
C5
D3
C2

 

result :

desc<=5>5
a 1
b1 
c2 
d1 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous 

 

 

Assuming Amount is a physical column in your table, the measure would be

CALCULATE (
    DISTINCTCOUNT ( 'table'[desc] ),
    keepfilers ( 'table'[amount] ) <= 5
)

But youre expected result is confusing thouugh. I thought you wanted the distinct count which means that each value in desc should only be counted once - C has 2. If you mean to say the count of records, use:

CALCULATE (
    COUNTROWS ( 'table' ),
    keepfilers ( 'table'[amount] ) <= 5
)

Just change <= to  > for a different calculation.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
v-achippa
Community Support
Community Support

Hi @Anonymous,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Thank you @danextian and @ryan_mayu for the prompt response.

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by ryan resolved your issue? or let us know if you need any further assistance.
If any response resolved your issue, please mark it as "Accept as solution" and give a kudos if you found it helpful.

 

Thanks and regards,

Anjan Kumar Chippa

ryan_mayu
Super User
Super User

@Anonymous 

you can try this

 

>5 = CALCULATE(COUNTROWS('Table'),'Table'[Amount]>5)
 
measure = CALCULATE(COUNTROWS('Table'),'Table'[Amount]<=5)
 
then update the measure name to <=5
11.png




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




danextian
Super User
Super User

Hi @Anonymous 

 

 

Assuming Amount is a physical column in your table, the measure would be

CALCULATE (
    DISTINCTCOUNT ( 'table'[desc] ),
    keepfilers ( 'table'[amount] ) <= 5
)

But youre expected result is confusing thouugh. I thought you wanted the distinct count which means that each value in desc should only be counted once - C has 2. If you mean to say the count of records, use:

CALCULATE (
    COUNTROWS ( 'table' ),
    keepfilers ( 'table'[amount] ) <= 5
)

Just change <= to  > for a different calculation.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

It doesn't works...

Let me clarify , I've 50 million rows so i have summarized table in PBI, you can see sample below.

I need classifcation <5, >5 based on description count & sales.

 

we need the result based on the input 'summarize table' . suggest on DAX

 

tried measurement

Test = COUNTAX('table',[amount]>5)

desc <5 = IF([amount]<5,[desc])    //description count
desc >5 = IF([amount]>5,[desc])     //description count

example : sum table in PBI

DescAmount
A10
B4
C5
D3
C2

 

result :

desc<=5>5
a 1
b1 
c2 
d1

 

 

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.