Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Guys,
I need a help with the case below:
How to write it in Dax or Powerquery a code like this below:
Expected Result =
VAR V_ID = 1
RETURN
if('Table'[OverflowAlarm] = 1 && 'Table'[Previus row] = 0, V_ID,
if('Table'[OverflowAlarm] = 0 && 'Table'[Previus row] = 1, V_ID = V_ID +1 ,
if ('Table'[OverflowAlarm] = 1 && 'Table'[Previus row] = 1, 'Table'[OverflowAlarm],0
)))
I have a table like that:
Time/date | Point_Id | Index | Duration | OverflowAlarm | Previus row |
14/03/2018 23:45 | PDD11148 | 78241 | 15 | 1 | |
14/03/2018 23:30 | PDD11148 | 78242 | 15 | 1 | 1 |
14/03/2018 23:15 | PDD11148 | 78243 | 15 | 1 | 1 |
14/03/2018 23:00 | PDD11148 | 78244 | 15 | 1 | 1 |
14/03/2018 22:45 | PDD11148 | 78245 | 15 | 1 | 1 |
14/03/2018 22:30 | PDD11148 | 78246 | 15 | 1 | 0 |
14/03/2018 22:15 | PDD11148 | 78247 | 0 | 0 | 0 |
14/03/2018 22:00 | PDD11148 | 78248 | 0 | 0 | 0 |
14/03/2018 21:45 | PDD11148 | 78249 | 0 | 0 | 0 |
14/03/2018 21:30 | PDD11148 | 78250 | 0 | 0 | 0 |
14/03/2018 21:15 | PDD11148 | 78251 | 0 | 0 | 0 |
14/03/2018 21:00 | PDD11148 | 78252 | 0 | 0 | 0 |
14/03/2018 20:45 | PDD11148 | 78253 | 0 | 0 | 1 |
14/03/2018 20:30 | PDD11148 | 78254 | 15 | 1 | 0 |
14/03/2018 20:15 | PDD11148 | 78255 | 0 | 0 | 1 |
14/03/2018 20:00 | PDD11148 | 78256 | 15 | 1 | 1 |
14/03/2018 19:45 | PDD11148 | 78257 | 15 | 1 | 1 |
14/03/2018 19:30 | PDD11148 | 78258 | 15 | 1 | 1 |
14/03/2018 19:15 | PDD11148 | 78259 | 15 | 1 | 1 |
14/03/2018 19:00 | PDD11148 | 78260 | 15 | 1 | 1 |
And that is the result that I need:
Point_Id | Index | Duration | OverflowAlarm | Previus row | Expected Result |
PDD11148 | 78241 | 15 | 1 | event 1 | |
PDD11148 | 78242 | 15 | 1 | 1 | event 1 |
PDD11148 | 78243 | 15 | 1 | 1 | event 1 |
PDD11148 | 78244 | 15 | 1 | 1 | event 1 |
PDD11148 | 78245 | 15 | 1 | 1 | event 1 |
PDD11148 | 78246 | 15 | 1 | 0 | event 1 |
PDD11148 | 78247 | 0 | 0 | 0 | |
PDD11148 | 78248 | 0 | 0 | 0 | |
PDD11148 | 78249 | 0 | 0 | 0 | |
PDD11148 | 78250 | 0 | 0 | 0 | |
PDD11148 | 78251 | 0 | 0 | 0 | |
PDD11148 | 78252 | 0 | 0 | 0 | |
PDD11148 | 78253 | 0 | 0 | 1 | |
PDD11148 | 78254 | 15 | 1 | 0 | event 2 |
PDD11148 | 78255 | 0 | 0 | 1 | |
PDD11148 | 78256 | 15 | 1 | 1 | event 3 |
PDD11148 | 78257 | 15 | 1 | 1 | event 3 |
PDD11148 | 78258 | 15 | 1 | 1 | event 3 |
PDD11148 | 78259 | 15 | 1 | 1 | event 3 |
PDD11148 | 78260 | 15 | 1 | 1 | event 3 |
Any help is welcome!
Thanks
They've surrounded us. thanks for all you have done
@Anonymous ,
You may take a look at the post below.
Hi,
@v-chuncz-msft wrote:@Anonymous ,
You may take a look at the post below.
Thanks for your response.
I am not a Power Bi expert, I've been working only few weeks with it. But, I couldn't see it working for me. And the function earlier doesn't work well... too many rows in the table, it runs forever... Any other solution?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |