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
soji
Frequent Visitor

Using Loop in DAX

 

I am struck in one of the process to get the worked location of each employee for each date as i am not sure how to use Loop in DAX.

I have two tables as Worked location Table and Location Transfer Table as shown below and i want to get the worked location details in the worked location table from the Location Transfer Table as show in the 3rd table. Can you please help how to do it in PBI DAX. Thanks

Worked Location Table  
DateEmployee IDWorked Location
01-May-2312301 
02-May-2312301 
03-May-2312301 
04-May-2312301 
05-May-2312301 
06-May-2312301 
07-May-2312301 
08-May-2312301 
09-May-2312301 
10-May-2312301 

 

Location Transfer Table   
Employee IDWorked LocationFrom DateTo Date
12301MCC01-May-2303-May-23
12301DCC04-May-2308-May-23
12301IBN09-May-23 

 

Worked Location Table RESULT
DateEmployee IDWorked Location
01-May-2312301MCC
02-May-2312301MCC
03-May-2312301MCC
04-May-2312301DCC
05-May-2312301DCC
06-May-2312301DCC
07-May-2312301DCC
08-May-2312301DCC
09-May-2312301IBN
10-May-2312301IBN
1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

4 REPLIES 4
Ahmedx
Super User
Super User

pls try this

Sample PBIX file attached

https://1drv.ms/u/s!AiUZ0Ws7G26RiENbao3SlhO1c9yr?e=Dh3R9Y

Screen Capture #1196.png

Hi @Ahmedx 

Ihave 2 table in my Power BI report B-Details and SPResult. SP result table is a stored procedure and will change dynamically with parameters. I want to create a new table from this in which it should filter Name and Country from B-Details and SPResult. Now after filtering this we have a uniquekey in B-Details. Now in the new table for each UniqueKey we have to get all the filtered values from SPResult table. So in the new table UniqueKey key row will be duplicated with as much rows we have in SPResult. Can you help me how to fix this?

create a new topic, show what you want to get, because it is not clear what you need

soji
Frequent Visitor

Thank you very much Ahmed, It really worked.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.