Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
RajKarun
Frequent Visitor

Power Bi Dax formula to sequentially number each occurrence of working/failure for the day

Hi All

I need a formula to sequencially number Working and down for a site and Machine Id for the day.

The first time it goes down in the day is 1 and the second time it goes down is 2. I could easily write a formula for each instance but I need them grouped and numbered,  so that I can measure the time it was continously working or down.

The first time it is working its 1 (same for down), the next time it is 2.

I need all the consecutive ones to be the same number so that I can create a summarize table to get the start and end time of the event (Working & Down) and time.

 

 

RajKarun_0-1726550688884.png

 

I was able to create a rankcc column but everytime it is working (site statsu = 1) it is duplicating as 1 but not incrementing it.

 

RajKarun_1-1726555107339.png

 

Any help is much appreciated.

Thanks Raj

 

3 REPLIES 3
RajKarun
Frequent Visitor

Hi All,
I have reposted/updated as I believe I might have confused you with the code etc.
I have attached the data below. I need the yellow column "count"

The table is sorted by site, Machine Id & Date/Time,

RajKarun_0-1727055553237.png

 

I want to create a table that displays the following result.
The main filters are the date, Machine ID & Site.

I have used the count column to identify the occurances.

RajKarun_1-1727055692693.png

RajKarun
Frequent Visitor

Hi thanks for your reply. I was trying to use index but didnot help.

this was the actual code

 

RajKarun_0-1726584289731.png

 

 

some_bih
Super User
Super User

Hi @RajKarun I just notice: in VAR part there is index column reference but not in RANKX formula definition?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors