cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NickNg278
New Member

Power Query/M Code help

Hi Community and Experts,

I am looking for helps and suggestions on the Power Query transformation. This is my initial input:

MemberIDDateStatus
11/1/20211
11/5/20211
12/3/20210
12/5/20211
13/3/20210
13/3/20211
13/8/20211

This is what I am expecting in my output:

MemberIDStart DateEnd Date
11/1/20212/3/2021
12/5/20213/3/2021
13/3/20213/8/2021

1 is active status, 2 is deactivate status. Every time the member logs in, it will be recorded as 1. If the member havent logged in a X number of days, they will be deativated and status set to 0, and has to log in to get their status change to 1. My output is just the number of active days for each member. 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @NickNg278,

The simple way is adding two custom columns to extract the date values when status equal to 1 or 0.
Then you can use the 'fill' feature to fill the blank values and add a filter to keep rows that include 'start' and 'end' dates.

Fill values in a column | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @NickNg278,

The simple way is adding two custom columns to extract the date values when status equal to 1 or 0.
Then you can use the 'fill' feature to fill the blank values and add a filter to keep rows that include 'start' and 'end' dates.

Fill values in a column | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors