Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Everyone,
I trying to find the to total rack count with the dax, can anyone help me to write a dax in power bi.
current state is 7 and the next state is 8. If so, it adds 1 to the rack count.
# should not consider current state = 8 and the next state = 7 or state = 7 or state = 8
State | timestamp |
7 | 01-02-2025 00:04:06 |
7 | 01-02-2025 00:04:11 |
7 | 01-02-2025 00:04:15 |
8 | 01-02-2025 00:04:23 |
8 | 01-02-2025 00:04:43 |
1 | 01-02-2025 00:04:51 |
1 | 01-02-2025 00:05:35 |
1 | 01-02-2025 00:14:51 |
7 | 01-02-2025 00:14:59 |
7 | 01-02-2025 00:15:06 |
7 | 01-02-2025 00:15:39 |
7 | 01-02-2025 00:20:47 |
7 | 01-02-2025 00:20:55 |
8 | 01-02-2025 00:21:06 |
8 | 01-02-2025 00:21:35 |
8 | 01-02-2025 00:21:43 |
9 | 01-02-2025 00:21:47 |
7 | 01-02-2025 00:21:51 |
7 | 01-02-2025 00:21:55 |
7 | 01-02-2025 00:22:31 |
7 | 01-02-2025 00:22:35 |
8 | 01-02-2025 00:22:39 |
8 | 01-02-2025 00:22:43 |
1 | 01-02-2025 00:22:50 |
1 | 01-02-2025 00:22:59 |
9 | 01-02-2025 00:23:19 |
7 | 01-02-2025 00:23:27 |
7 | 01-02-2025 00:23:31 |
7 | 01-02-2025 00:23:35 |
8 | 01-02-2025 00:24:15 |
8 | 01-02-2025 00:24:19 |
1 | 01-02-2025 00:24:27 |
8 | 01-02-2025 00:21:06 |
8 | 01-02-2025 00:21:06 |
8 | 01-02-2025 00:21:06 |
1 | 01-02-2025 00:21:06 |
1 | 01-02-2025 00:21:06 |
1 | 01-02-2025 00:21:06 |
7 | 01-02-2025 00:21:06 |
7 | 01-02-2025 00:21:06 |
1 | 01-02-2025 00:21:06 |
1 | 01-02-2025 00:21:06 |
8 | 01-02-2025 00:21:06 |
8 | 01-02-2025 00:21:06 |
7 | 01-02-2025 00:21:06 |
7 | 01-02-2025 00:21:06 |
1 | 01-02-2025 00:21:06 |
Solved! Go to Solution.
I used below method to solve it,
A) created Index calculated column
Total count of rack should be 4. Below group will be counted as 1 rack and it should follow the sequence, 7 and then 8
7 | 01-02-2025 00:04:06 |
7 | 01-02-2025 00:04:11 |
7 | 01-02-2025 00:04:15 |
8 | 01-02-2025 00:04:23 |
8 | 01-02-2025 00:04:43 |
@adarshmp8998 OK, so you the min date and time and then you are looking for where the next row is 0 or +1 different from that. So what are the other 4 racks? I still don't understand the logic here. Is it only the instances where it goes form 7 to 8 that count? So if there are consecutive 7's but no 8 then that does not count? What about the 1's?
Seems similar to Cthulhu/Streaks. Streaks! - Microsoft Fabric Community. Off the cuff, maybe:
I used below method to solve it,
A) created Index calculated column
@adarshmp8998 So what is the expected output from this?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |