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

View all the Fabric Data Days sessions on demand. View schedule

Reply
shreep1
Helper III
Helper III

Pivot Table replication in PowerBI

Hello Team,

 

@Amit@Greg , @tamerj1 , @lbendlin,

 

@amitchandak , @olgad , @Sahir_Maharaj , @FreemanZ , @tamerj1 , @Greg_Deckler 

 

@christinepayton @audreygerred 

 

@LukeB,

 

@Kedar_Pande 

 

@rajendraongole1 

 

@Ritaf1983 

 

@SamWiseOwl 

 

I need to replicate the Pivot Table in Excel in my PowerBI. Pivot Table looks like this:

 

shreep1_0-1739232102392.png

 

My current dataset looks like this:

 

shreep1_1-1739232125439.png

 

I want to write an algorithm where it gives the summation of Avg Planned Cyc Time for each of the ESN Prefix for their corresponding Station No and it should reflect the Grand Total value of 764 towards the end counting the sum of all the Avg Planned Cyc Time for the list of Station No. EAC Serial are under the ESN Prefix.  

My Avg Planned Cyc Time column inside this data table is a Measure inside the Measures Table based on T_Cycle_Takt_Time_Detail data table where it is:

Avg Planned Cyc Time = AVERAGE(T_Cycle_Takt_Time_Detail[Planned Time [min]]])

I have written following algorithms but none of them are working for all the Prefixes when I put them on a slicer(filtering box) inside the PowerBI dashboard.

 

Grand Total Prefix 4 = SUMX('T_Cycle_Takt_Time_Detail', 'T_Cycle_Takt_Time_Detail'[Planned Time [min]]])

 

Grand Total Prefix 8 = SUMX(VALUES('T_Cycle_Takt_Time_Detail'), [Avg Planned Cyc Time])

 

Grand Total Prefix 9 = SUMX(SUMMARIZE('T_Cycle_Takt_Time_Detail','T_Cycle_Takt_Time_Detail'[Prefix],"AvgTime",[Avg Planned Cyc Time]),[AvgTime])

 

Grand Total 10 = VAR CurrentESNPrefix = SELECTEDVALUE('T_Cycle_Takt_Time_Detail'[Prefix]) RETURN SUMX(FILTER('T_Cycle_Takt_Time_Detail', 'T_Cycle_Takt_Time_Detail'[Prefix] = CurrentESNPrefix), 'MEASURE'[Avg Planned Cyc Time])

 

My best algorithm is Grand Total Prefix 4 or Grand Total Prefix 8  where it works and correctly gives the correct Grand Total for most of the Prefixes but very incorrect results for some of the Prefixes due to which I cannot use it.

 

Can you please suggest a better algorithm? Why is this algorithm not working. Is it because of filter context or the PowerBI dashboard being too old or something else.

 

I will appreciate more than any help.

 

Thanks,

 

 

 

 

 

 

2 REPLIES 2
shreep1
Helper III
Helper III

Hello @Ashish_Mathur ,

 

I cannot share the PBI file. My expected result is that it correctly shows the correct Grand Total(summation of Avg Planned Cyc Time for all the stations belonging to that Prefix) when I use the prefix slicer. Its working for most of the Prefixes but not for all. 

 

Thanks

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors