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
batranikhil
Frequent Visitor

COUNTIF on a New Measure

Hi, 

 

I'm having challenge with counting the number of rows, when a New Measure is over a certain limit. 

e.g. I have a table with multiple transactions for multiple people in terms of Amounts Deposited and Withdrawn like follows:

NameAmount DepositedAmount Withdrawn
James078
Max1000
Struss056
Phil120
James032
Max340
Struss045
Phil570
James340
Max085
Struss220
Phil022
James330
Max034
Struss880
Phil044

 

I have created a 'New Measure' in Power BI Report, to give me the 'percentage of Amount Withdrawn/Amount Deposited' for each "Name". I have been able to succesfully do that. 

 

Now I want to Count IF this new measure, 'percentage of Amount Withdrawn/Amount Deposited', is over 100%. And have one of the Visuals such as 'Card' show that on the power BI report. My report in production has over a 100k rows with over 10k unique users. 

What formula, DAX query can I use to create this new Measure? or some other workaround. 

 

Cheers,

Nikhil

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@batranikhil , Please refer these measures

 

% Withdrawn = Divide(Sum(Table[Amount Withdrawn]), Sum(Table[Amount Deposited]))

 

% GT 100 = countx(Values(Table[Name]), if([% Withdrawn] >1 , [Name], blank() ) )

Thanks Amit - worked beautifully. 

 

Can you also help with what to use if I were to build a pie chart depicting 5 groups:

above 200%, 100-200%, 76-100%, 50-75%, and less than 50%. 

Any direction would help. 

 

Cheers,

Nikhil

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.