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

Using different columns for measure depening on user selection in excel pivot table

Hi,

 

I am still a beginner but I have the following use case and I am not sure if and how it is possible to set it up:

 

Let's say I have the following table:

 

 Actual RevenuePlan Revenue
Project A109
Project B89
Project C55

 

I have then added a measure that calculates the Actual vs Plan percentage. 

Our users are not really interacting with the dataset in Power BI directly, but instead in Excel through Data -> Get Data -> From Power Platform -> From Power BI as a pivot table.

 

But now we have an addition of a second plan. So the table is now:

 Actual RevenuePlan 1 RevenuePlan 2 Revenue
Project A10913
Project B8911
Project C553

 

Ideally, I would like to avoid having 2 separate measures like Actual vs Plan 1 and Actual vs Plan 2, and just have one measure, using the Plan value based on the users, if he wants to use Plan 1 or Plan 2.

 

Is there a way to do this, so the user can use it in excel's pivot tables as well?

 

Thanks!

 

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

Hi @Hambach ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Select the [Plan 1 Revenue] column and the [Plan 2 Revenue] column in the power query editor to transpose.

vtangjiemsft_0-1678260595020.png

(3)We can create a measure. 

Plan percentage = 
DIVIDE(SUM('Table'[Revenue]),SUM('Table'[Actual Revenue]),0)

(4) Filter the [Plan] field in the pivot tables.

vtangjiemsft_1-1678261974077.pngvtangjiemsft_2-1678261991755.png

 

 

Best Regards,

Neeko Tang

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

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @Hambach ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) Select the [Plan 1 Revenue] column and the [Plan 2 Revenue] column in the power query editor to transpose.

vtangjiemsft_0-1678260595020.png

(3)We can create a measure. 

Plan percentage = 
DIVIDE(SUM('Table'[Revenue]),SUM('Table'[Actual Revenue]),0)

(4) Filter the [Plan] field in the pivot tables.

vtangjiemsft_1-1678261974077.pngvtangjiemsft_2-1678261991755.png

 

 

Best Regards,

Neeko Tang

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

FreemanZ
Super User
Super User

hi @Hambach 

you shall know a power feature called field parameter, with which the user could decide which measure to plot in a visual. But it works only on Power BI.

 

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors