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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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