Forum Discussion
idymkowski
5 years agoNew Member
Creating a condition based event counter
I have a dataset with time and inventory levels. I want to create a counter (within a designated time period) of the # of unique rows where the inventory drops below a specified limit (in this examp...
HashamNiaz
5 years agoSolution Sage
Hi idymkowski !
You can create a custom column using below DAX;
IsBelow = IF(Table[Inverntory] < 1000, 1, 0)
This will give you a 1/0 flag whether Inventory is below the limit or not, now you can use this column to create a measure which will sum / count these occurences.
BelowLimit = SUM(Inventory[IsBelow])
Regards,
Hasham
idymkowski
5 years agoNew Member
If I am reading that correctly, it will flag a "1" for each occurance below 1000. For the first part of my question, I'm only looking for the flag to be there for the 1st record below 1000 (and then reset once the inventory rises above 1000 again).
- HashamNiaz5 years agoSolution Sage
Hi idymkowski !
Got it, please paste sample data for your problem. I have overlooked your initial requirement.
Regards,
Hasham
- idymkowski5 years agoNew Member
a sample spreadsheet was in the original post. Do you need more than that?