This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
Wanted to have calcualted column based on the Value column >0 based on Date and Partial attributes and it should repeate every month for different partial as mentioned below.
any help
| Dt | Partial | Value | Row starts |
| 01-01-2025 | L1 | 0 | 0 |
| 01-01-2025 | L1 | 0 | 0 |
| 01-01-2025 | L1 | 1 | 1 |
| 01-02-2025 | L1 | 1 | 2 |
| 01-02-2025 | L1 | 0 | 3 |
| 01-02-2025 | L1 | 0 | 4 |
| 01-03-2025 | L1 | 0 | 5 |
| 01-03-2025 | L1 | 30 | 6 |
| 01-03-2025 | L1 | 0 | 7 |
| 01-04-2025 | L1 | 25 | 8 |
| 01-04-2025 | L1 | 0 | 9 |
| 01-04-2025 | L1 | 0 | 10 |
| 01-01-2025 | L2 | 0 | 0 |
| 01-01-2025 | L2 | 0 | 0 |
| 01-01-2025 | L2 | 0 | 0 |
| 01-02-2025 | L2 | 0 | 0 |
| 01-02-2025 | L2 | 0 | 0 |
| 01-02-2025 | L2 | 0 | 0 |
| 01-03-2025 | L2 | 3 | 1 |
| 01-03-2025 | L2 | 6 | 2 |
| 01-03-2025 | L2 | 19 | 3 |
| 01-04-2025 | L2 | 0 | 4 |
| 01-04-2025 | L2 | 0 | 5 |
| 01-04-2025 | L2 | 20 | 6 |
Solved! Go to Solution.
Hi @Anonymous ,
To calculate a running row number in a calculated column based on Value > 0, grouped by Partial and maintaining the row sequence across time, you can use DAX like this:
Row starts =
VAR CurrentDate = [Dt]
VAR CurrentPartial = [Partial]
VAR CurrentIndex = [Index]
RETURN
IF (
[Value] > 0,
CALCULATE (
COUNTROWS (
FILTER (
YourTable,
[Partial] = CurrentPartial &&
[Dt] <= CurrentDate &&
[Value] > 0 &&
[Index] <= CurrentIndex
)
)
),
0
)
This assumes you already have a unique [Index] column that ensures each row has a deterministic order. The logic checks if the current row has Value > 0. If so, it counts all prior rows with the same Partial, date up to the current one, and with Value > 0. This count becomes the row number. If Value is zero, it returns 0. The row number continues to increment for each non-zero value across time, separately for each Partial.
Best regards,
Hi @Thimma_pbi ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @Thimma_pbi ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @Anonymous ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @Anonymous ,
To calculate a running row number in a calculated column based on Value > 0, grouped by Partial and maintaining the row sequence across time, you can use DAX like this:
Row starts =
VAR CurrentDate = [Dt]
VAR CurrentPartial = [Partial]
VAR CurrentIndex = [Index]
RETURN
IF (
[Value] > 0,
CALCULATE (
COUNTROWS (
FILTER (
YourTable,
[Partial] = CurrentPartial &&
[Dt] <= CurrentDate &&
[Value] > 0 &&
[Index] <= CurrentIndex
)
)
),
0
)
This assumes you already have a unique [Index] column that ensures each row has a deterministic order. The logic checks if the current row has Value > 0. If so, it counts all prior rows with the same Partial, date up to the current one, and with Value > 0. This count becomes the row number. If Value is zero, it returns 0. The row number continues to increment for each non-zero value across time, separately for each Partial.
Best regards,
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 25 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 36 | |
| 32 | |
| 25 | |
| 23 |