Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I want to count the number of days that each plat is in the same status.
Date Plate Status
15/fev ABC1111 Manutenção
14/fev ABC1111 Manutenção
13/fev ABC1111 Manutenção
12/fev ABC1111 Manutenção
11/fev ABC1111 Em Preparação
10/fev ABC1111 Em Preparação
09/fev ABC1111 Manutenção
08/fev ABC1111 Manutenção
07/fev ABC1111 Manutenção
06/fev ABC1111 Em Preparação
05/fev ABC1111
04/fev ABC1111
03/fev ABC1111
02/fev ABC1111
01/fev ABC1111
15/fev ABC2222 Em Preparação
14/fev ABC2222 Em Preparação
13/fev ABC2222 Em Preparação
12/fev ABC2222 Em Preparação
11/fev ABC2222 Em Preparação
10/fev ABC2222 Em Preparação
09/fev ABC2222 Em Preparação
08/fev ABC2222 Em Preparação
07/fev ABC2222 Em Preparação
06/fev ABC2222 Em Preparação
05/fev ABC2222 Em Preparação
04/fev ABC2222 Em Preparação
03/fev ABC2222 Em Preparação
02/fev ABC2222 Em Preparação
01/fev ABC2222 Em Preparação
15/fev ABC3333 Manutenção
14/fev ABC3333 Em Preparação
13/fev ABC3333 Em Preparação
12/fev ABC3333 Em Preparação
11/fev ABC3333 Em Preparação
10/fev ABC3333 Em Preparação
09/fev ABC3333 Em Preparação
08/fev ABC3333 Em Preparação
07/fev ABC3333 Em Preparação
06/fev ABC3333 Em Preparação
05/fev ABC3333 Em Preparação
04/fev ABC3333 Em Preparação
03/fev ABC3333 Em Preparação
02/fev ABC3333 Em Preparação
01/fev ABC3333 Em Preparação
Result: ABC1111 - Manutenção - 4 days
ABC2222- Em Preparação - 15 days
ABC3333 - Manutenção - 1 day
Solved! Go to Solution.
Hi @Júlio ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Last Status =
VAR cur_plate =
SELECTEDVALUE ( 'Table'[Plate] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [Plate] = cur_plate )
VAR max_date =
MAXX ( tmp, [Date] )
VAR tmp1 =
FILTER ( ALL ( 'Table' ), [Date] = max_date && [Plate] = cur_plate )
RETURN
CALCULATE ( MAX ( [Status] ), tmp1 )
Days =
VAR cur_status = [Last Status]
VAR cur_plate =
SELECTEDVALUE ( 'Table'[Plate] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [Status] = cur_status && [Plate] = cur_plate )
RETURN
COUNTROWS ( tmp )
3. add a table visual with field and mesure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Júlio ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Last Status =
VAR cur_plate =
SELECTEDVALUE ( 'Table'[Plate] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [Plate] = cur_plate )
VAR max_date =
MAXX ( tmp, [Date] )
VAR tmp1 =
FILTER ( ALL ( 'Table' ), [Date] = max_date && [Plate] = cur_plate )
RETURN
CALCULATE ( MAX ( [Status] ), tmp1 )
Days =
VAR cur_status = [Last Status]
VAR cur_plate =
SELECTEDVALUE ( 'Table'[Plate] )
VAR tmp =
FILTER ( ALL ( 'Table' ), [Status] = cur_status && [Plate] = cur_plate )
RETURN
COUNTROWS ( tmp )
3. add a table visual with field and mesure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hi @Júlio
you can just plot a table visual with all three column.
ensure you choose count for the date column.
it worked like this:
That's exactaly my problem.
As you can see the result for the plate ABC1111 on the status of "Manutenção" is 7.
But i wanna know how many days is on the same status, so the correct result is 4.
I don't wanna count the total, only the last status of each plate.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
14 | |
11 | |
8 |
User | Count |
---|---|
25 | |
21 | |
12 | |
11 | |
10 |