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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GilesWalker
Skilled Sharer
Skilled Sharer

How to do a sumifs formula

Hi everyone,

 

I have been trying to figure out the best way to show this data. I have this table in excel:

 

RouteMonTueWedThuFriSatSun
BAY-BIE012121212120
BIE-BAY101010100100
BIE-BTN6666666666660
BIE-LTN2828282828280
BTN-BIE5858585858580
BTN-DPO1212121212120
DPO-BTN1212121212120
ETJ-BAY101010101000
ETJ-BIE1212121212120
ETJ-BTN161616161600

 

The Routes relate to the same routes in the company database. The numbers in the table are forecast numbers for each day. I need to compare these against the actual numbers on that route on any given day. For example, the forecast for route BIE-BTN is 66 each day except Sunday.

 

In PBI I have a standard date key table created using calculated columns, one of those columns contains the day of the week (Mon, Tue, etc) I have also entered columns with the above figures as calculated columns, eg: 

 

BIE-BTN = IF(DateKey[Day]="Sun", 0, 66)

 

I need a graph to be able to show all the routes on the X-axis then on the first Y-axis the actual delivered numbers, then on the second Y-axis the forcasted number. The forecasted number needs to be a dot point over the relevant route. The problem I am running into is that I cant get PBI to do this. The picture below shows the actuals delivered in the bars, and the forecast for BIE-BTN

 

BIEBTN.PNG

 

The line goes across all routes in the graph.

 

I have tried showing this data in a table format and the same issue arises. Open to suggestions on if there is a better way. At the moment in appears as though it will be a seperate graph for each route which is not ideal.

 

Thanks,

 

Giles

2 REPLIES 2
GilesWalker
Skilled Sharer
Skilled Sharer

I came up with a possible fix. I have changed the table (called Plus 50 forecast) with the forecast numbers in to be:

RouteTotals
BAY-BIE12
BIE-BAY10
BIE-BTN66
BIE-LTN28
BTN-BIE58
BTN-DPO12
DPO-BTN12
ETJ-BAY10
ETJ-BIE12
ETJ-BTN16

 

These numbers dont change except for certain days where they are zero. Then I created two measures:

 

Count of days = COUNTA(DateKey[Date])

This counts how many days are selected in the date slicer on the page.

 

This is then joined to this measure:

 

Forecast = SUM('Plus 50 forecast'[Totals])*[Count of days]

 

This measure is placed in the line section of the Line and Bar chart. Now I get the correct forecast number above the relevant route on the x-axis. However how can I get the measure to account for the days which are 0 forecast? Currently it just takes the number from the above table and multiplies it by however many days are selected.

 

Hope someone can help with this.

 

 

How about you change the data with the following format:

Route Date Values
BAY-BIE Mon 0
BAY-BIE Tue 12
BAY-BIE Wed 12
BAY-BIE Thu 12
BAY-BIE Fri 12
BAY-BIE Sat 12
BAY-BIE Sun 0
BIE-BAY Mon 10
BIE-BAY Tue 10
BIE-BAY Wed 10
BIE-BAY Thu 10
BIE-BAY Fri 0
BIE-BAY Sat 10
BIE-BAY Sun 0 

 

Then add the a cacluated column with the formula: Forecast = CALCULATE(SUM([Values]), ALLEXCEPT('Plus 50 forecast', 'Plus 50 forecast'[Route]))

 

Or, you need to calculate the total value of all columns in each row in the Excel file first. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.