cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Show MTD Data based on different trading days per state

Hi All,

I am using the below formula to show tonnes per day based on different trading days in different states. The formula works in combination with a filter in which you can select the month you would like to see.

Daily Tonnes B =
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "NSW", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.NSW]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "QLD", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.QLD]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "VIC", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.VIC]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "TAS", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.TAS]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "WA", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.WA]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.NSW]),
1))))))

Currently I am building a table in which I want to show the same data, but bypass the need to select the month every month. The table should automatically show the data for the current month. I tried using the formulate below

Daily Tonnes B =
CALCULATE(
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "NSW", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.NSW]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "QLD", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.QLD]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "VIC", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.VIC]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "TAS", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.TAS]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "WA", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.WA]),
if(SELECTEDVALUE('Manu Table - Warehouse translation'[State]) = "", SUM('FY23 Budget'[Tonnes Total B])/SUM('Calendar'[Calendar - Budget trading days.NSW]),
1)))))),DATESMTD('FY23 Budget'[Year_Month]))
However, this is not showing the correct data. The date range in the FY23 Budget table only shows the first of the month with the totals for the month. Could that be an issue?

Thanks heaps
0 REPLIES 0

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors