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
Nash2Bos
Helper I
Helper I

trying to take an excel table into powerBI

Hello all, I have a table that looks like this

 

CITYITEMPlan/ActualWeek 1Week 2Week 3Week 4
BostonProductPlan105810
 ProductActual10489
 ServicePlan10489
 ServiceActual9884
 TotalPlan2091619
  Actual19121613
  Plus/Minus-1+30-6

The issue I am having is the total isnt a total of the column it is product.plan + service.plan and product.actual+service.actual. Also the plus minus in excel it is easy to to a formula for cells but not sure how to do it in PowerBI. 

I also have more cities this is just one city example. 

 

Thank you so much in advance for everyones help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Nash2Bos ,

 

Organize the data so that all rows of Total are at the bottom of all cities, and then all rows of Total have all values of 0.

vdengllimsft_0-1738896130250.png

 

Select the CITY,ITEM,Plan/Actual columns and unpivot other columns. Then click the Close & Apply button to load the data into Power BI.

vdengllimsft_2-1738896483338.png

 

Use the following measure as the value.

Total = 
VAR _item = SELECTEDVALUE('Table'[ITEM])
VAR _plan = SELECTEDVALUE('Table'[Plan/Actual])
VAR _value = SUM('Table'[Value])
VAR _TotalActualValue = CALCULATE(SUM('Table'[Value]),'Table'[ITEM] IN {"Product","Service"} && 'Table'[Plan/Actual]="Actual"&&'Table'[CITY] <>BLANK())
VAR _TotalPlanValue = CALCULATE(SUM('Table'[Value]),'Table'[ITEM] IN {"Product","Service"} && 'Table'[Plan/Actual]="Plan"&&'Table'[CITY] <>BLANK())
RETURN
IF(_item IN {"Product","Service"},_value,
    SWITCH(_plan,
            "Actual", _TotalActualValue,
            "Plan", _TotalPlanValue,
            "Plus/Minus", _TotalActualValue - _TotalPlanValue
    )
)

 

Create a matrix using fields and the measure. 

vdengllimsft_3-1738897094052.png

 

For multiple cities.

The source data is as follows.

vdengllimsft_4-1738897163199.png

The final result is as follows. Hopefully it will meet your needs.

vdengllimsft_5-1738897257280.png


Please see the attached pbix for reference.

 

Best Regards,
Dengliang Li

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
Anonymous
Not applicable

Hi @Nash2Bos ,

 

Organize the data so that all rows of Total are at the bottom of all cities, and then all rows of Total have all values of 0.

vdengllimsft_0-1738896130250.png

 

Select the CITY,ITEM,Plan/Actual columns and unpivot other columns. Then click the Close & Apply button to load the data into Power BI.

vdengllimsft_2-1738896483338.png

 

Use the following measure as the value.

Total = 
VAR _item = SELECTEDVALUE('Table'[ITEM])
VAR _plan = SELECTEDVALUE('Table'[Plan/Actual])
VAR _value = SUM('Table'[Value])
VAR _TotalActualValue = CALCULATE(SUM('Table'[Value]),'Table'[ITEM] IN {"Product","Service"} && 'Table'[Plan/Actual]="Actual"&&'Table'[CITY] <>BLANK())
VAR _TotalPlanValue = CALCULATE(SUM('Table'[Value]),'Table'[ITEM] IN {"Product","Service"} && 'Table'[Plan/Actual]="Plan"&&'Table'[CITY] <>BLANK())
RETURN
IF(_item IN {"Product","Service"},_value,
    SWITCH(_plan,
            "Actual", _TotalActualValue,
            "Plan", _TotalPlanValue,
            "Plus/Minus", _TotalActualValue - _TotalPlanValue
    )
)

 

Create a matrix using fields and the measure. 

vdengllimsft_3-1738897094052.png

 

For multiple cities.

The source data is as follows.

vdengllimsft_4-1738897163199.png

The final result is as follows. Hopefully it will meet your needs.

vdengllimsft_5-1738897257280.png


Please see the attached pbix for reference.

 

Best Regards,
Dengliang Li

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

Thank you! 
quick question what if I want to do a plus/minus by city in between and then a final plus/minus at the bottom?

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