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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Balaraju
Helper II
Helper II

How To split alternative rows into different name

Hi All Good Morning,

 

I have one scenario like a time column having time for every day based on user ID, time column will give the in and out the tracking of the user. Consider every day first-time stamp is In next timestamp is out same vice versa.

Could you please see the below data so you can get a better understanding? adding input and expecting out results.

 

Balaraju_0-1661323496923.png

 

 

 

Please help out on it.

Regards,

Balaraju.

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

Hi @Balaraju,

 

Please create an index column in Power Query.

vyadongfmsft_0-1661506649582.png

 

Then try following DAX:

Type = 
var cur_index='table'[Index]
var confirm=MOD(cur_index,2)
return
IF(confirm=0,"Out","In")

 

You can get result you want.

vyadongfmsft_1-1661506649587.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yadongf-msft
Community Support
Community Support

Hi @Balaraju,

 

Please create an index column in Power Query.

vyadongfmsft_0-1661506649582.png

 

Then try following DAX:

Type = 
var cur_index='table'[Index]
var confirm=MOD(cur_index,2)
return
IF(confirm=0,"Out","In")

 

You can get result you want.

vyadongfmsft_1-1661506649587.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HoangHugo
Solution Specialist
Solution Specialist

Hi

My idea, I will base on number of time recorded to define "In" mean Odd number, "Out" mean Even Number

 

column

Output = if (MOD(COUNTROW(CALCULATETABLE(table, Date = EARLIER (Date), Time <= EARLIER (Time),2) =0,"Out","In")

Sorry It is not working

 

Can you share notice after create Column?, make sure your Date column Time column in right type (Date/Time) to make comparision.

Balaraju_0-1661326562706.jpeg

 

yes, use right opening and closing to make right EARLIER function

EARLIER(Attendance[Date])

EARLIER(Attendance[Time])

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.