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
Anonymous
Not applicable

How to write dax possitive values and nagative values sepeterately count.

Hi ,

Please help on below issues.

how to show positive valies count and nagative values count separately

positive :60

Nagitive values :40

Amount
10
20
30
-40
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello @Anonymous 

 

Can you try with the below DAX measures

 

PositiveCount = 

CALCULATE(  COUNTROWS(NumbersCount),  FILTER(NumbersCount,NumbersCount[Values]>0))
 
NegativeCount=
CALCULATE(  COUNTROWS(NumbersCount),  FILTER(NumbersCount,NumbersCount[Values]<0))
 
Alternatively,
PositiveCount = COUNTAX( NumberTable, IF(NumberTable[Number]>0,NumberTable[Number]))
 
NegativeCount = COUNTAX( NumberTable, IF(NumberTable[Number]<0,NumberTable[Number]))
 
Hit Like if it's helped your query
Nandri

View solution in original post

2 REPLIES 2
Uzi2019
Super User
Super User

hi @Anonymous 

 

please find below measures to calculate sum of positive and negative value

 

Positive =SUMX(table_name,IF(table_name[column ]>0,table_name[coulmn]))

Negative = SUMX(table_name,IF(table_name[column ]<0,table_name[coulmn]))

 

Please hit like and accept as a solution so other can get the answer.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Anonymous
Not applicable

Hello @Anonymous 

 

Can you try with the below DAX measures

 

PositiveCount = 

CALCULATE(  COUNTROWS(NumbersCount),  FILTER(NumbersCount,NumbersCount[Values]>0))
 
NegativeCount=
CALCULATE(  COUNTROWS(NumbersCount),  FILTER(NumbersCount,NumbersCount[Values]<0))
 
Alternatively,
PositiveCount = COUNTAX( NumberTable, IF(NumberTable[Number]>0,NumberTable[Number]))
 
NegativeCount = COUNTAX( NumberTable, IF(NumberTable[Number]<0,NumberTable[Number]))
 
Hit Like if it's helped your query
Nandri

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.