Help. Count all numbers >= 1 as 1

L

Legacy 301750

Guest
I'm creating a Dax formula where when I count the rows if the number is 1 or greater than one I get a return values of 1 and 0 is 0.

example

[Net Activations Count](sum)[Test Activation Count] (count)
11
21
41
00

<tbody>
</tbody>

The first column column counts the number records. The "Test Activation Count" counts all records on the Source column but will only return a 1 or 0.

The problem I'm getting is that the functions that I'm generating are a loop and I can't brake the loop.

Any guidance will be helpful
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the Board!

The problem I'm getting is that the functions that I'm generating are a loop and I can't brake the loop.
I am not sure I understand. Where exactly is this loop you are talking about?
 
Upvote 0
Welcome to the forum. We will always try to help.

What is the formula you are using? If the values in A are integers 0 and up, then:

B2= "=sign(A2)"

and then you can sum column B

or you could use Countif()

=COUNTIF(A2:A30,">0")
 
Upvote 0
Here is a sample function I have tried. hopefully this clears some

[Test Activation Count]=IF([Net Activation Count]=1,1,IF([Net Activation Count]>=2,1,0))

The column [Net Activation Count] is as rows can will have the any value starting on 0 and up. The [Test Activation Count] is Account of the previous column but only returning 0 or 1

--------

I can't use COUNTIF is a DAX (power pivot) function.
 
Upvote 0
nums
5
0
23
0Count of nums
0numsTotal
204
421
642
852
1061
081
5101
4231
Grand Total13
grand total minus number under total is what you need
=offset($f$1,match("total",f2:f1000,0) +1 ,0) finds the 4
=offset($e$1,match("Grand total",e2:e1000,0),1 findsthe 13

<colgroup><col span="4"><col><col><col span="6"></colgroup><tbody>
</tbody>
 
Upvote 0
I found kind of a hack to make it work.

=IFERROR(CALCULATE(SUM[Net Activations Count]/SUM[Net Activation Count])),0)

This does what I want. If you guys have any other suggesting, I'm all ears.


 
Upvote 0
The formula above worked but The only problem is that it will not total in the columns or rosin the power pivot table. Any suggestions? It seams to be applying the same formula to do the totals instead of summing up the row value or column value.

EX: the formula that is driving this is:
[Test Activation Count]=IFERROR(CALCULATE(SUM[Net Activations Count]/SUM[Net Activation Count])),0)

The result I'm getting is:
row sample[Test Activation Count]2[Test Activation Count]3[Test Activation Count]4Total
a1101
b1111
c0011
total1111

<tbody>
</tbody>

And I should be getting
row sample[Test Activation Count]2[Test Activation Count]3[Test Activation Count]4Total
a1102
b1113
c0011
total2226


<tbody>
</tbody>
 
Upvote 0
lets start again - col A is a list of numbers from zero to 99999
col B is 1 if number is not zero, zero if it is zero
let us say you have 17 "ones" and 4 zeroes

what do you want to do with that information
 
Upvote 0
Lets start with giving more background.

I'm creating mockups for some dashboards. Right now we are using data that is coming from an external excel file and the data model resides inside the excel document. Eventually all the data and calculated fields will move to the SQL server.

The purpose of this mockup is to give a presage of activations of a product in a period of time. The activations are done by store. In our Data, we have a fact that tells us how many products have been activated. This is by single product.

This Data looks like this:
fact: Sum of Net Activation Count

Net Activation Count
Store NameProduct 1Product 2Product 3Product 5Total
store113127
store202103
store321036
total362516

<tbody>
</tbody>


The next step is to figure out the if the product has been activated. So 0 of no and 1 if any products as been activated.

We are using this formula to get those numbers: =if([Sum of Net Activation Count] >0,1,0)

Once we use this formulate we get:
I'm calling this calculated field [Test Net Activation Count]
The results for this should be
Test Net Activation Count
Store NameProduct 1Product 2Product 3Product 5Total
store111114
store201102
store311013
total23229

<tbody>
</tbody>


The problem we are getting is that for the pivot table column we care getting a 1 instead of the sum of the values. This is the result:
Test Net Activation Count
Store NameProduct 1Product 2Product 3Product 5Total
store111111
store201101
store311011
total11111

<tbody>
</tbody>


The total is not summing the columns and instead using the same formula to get the total.

At the the end what we need is a the percentage of products activated. EX

Test Net Activation Count
Store NameProduct 1Product 2Product 3Product 7Total
store11111100%
store2011075%
store3110175%



<tbody>
</tbody>

Hope this makes sense
 
Upvote 0
too complicated, I do not understand - do it a bite at a time - answer my question - and what is meant by a product is activated....
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,517
Members
448,968
Latest member
Ajax40

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top