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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Power BI Python query

Hi guys,

Having trouble to find a solution for this. When run a Python query in my normal IDE i get the proper result:

Well Name              |   Phase    |       Value   | 

UNIVERSITY 20 PW 2502H |    INT     |       52.75    
TIGER 55-2-12 LOV 8H | MNH | 58.25
UNIVERSITY 20 TG UNIT | SRF | 25.50

but in PBI i am getting just:

 

52.75

58.25

25.50 

Without the index in my first picture. using the following code, do you know how i can get my normal answer with all index?

 

condition1 = df[df['Actual Operation']=='DRL']
condition1=pd.DataFrame(condition1.groupby(by=['Well Name', 'Phase'])['Sum of Activity Time (Hr)'].sum())
condition1=condition1[condition1.isin(condition1.groupby(['Phase']).min()['Sum of Activity Time (Hr)'].tolist())].dropna()

 

Thanks

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

@Anonymous ,

 

If you modify the last line like below, will the output be a table, not just a column?

condition1=condition1.isin(condition1.groupby(['Phase']).min()['Sum of Activity Time (Hr)'].tolist())

If this issue persists, please share sample data and complete python code.

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

If you modify the last line like below, will the output be a table, not just a column?

condition1=condition1.isin(condition1.groupby(['Phase']).min()['Sum of Activity Time (Hr)'].tolist())

If this issue persists, please share sample data and complete python code.

 

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.