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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Christophe_
Regular Visitor

Calculate daily turnover

Hello together
I have a date table (one row for each day) with a column "working day", which defines if the date is a working day (1), or not (0).
In a second table I have the daily sales per item code.
now i need a measure that multiplies the column working day with the daily turnover; with this i want to calculate the planned turnover per day.
But currently I have the problem that I don't know how to link the two table in a meaningful way (in the planning file I have no date, in the date file no category code).
Is it possibly useful to calculate the sales in the date table in Excel?
Or are there better possibilities?
Thanks for any help
Christophe

1 ACCEPTED SOLUTION

I think i have found a solution by replacing MAX with SUM

 

Output 1 =
SUMX(
    'Daten',
    Daten[Working Day] * SUM('Output daily'[Plan actual])
)

View solution in original post

4 REPLIES 4
Christophe_
Regular Visitor

Thank you @Greg_Deckler for your answer

 

I have two tables (see below), these are linked via the "Year" column.

Furthermore I have following measure:

Output =
SUMX(
    'Daten',
    Daten[Working Day] * MAX('Output daily'[Plan actual])
)

 

The measure should calculate the production output for each day per item. The matrix shows that the total per Item and month is calculated correctly. But the total per month (currently the total of article A ist output, i.e. the maximum value) and the grand total is not correct (6'006'000 is the total of article A, but not the total of all articles: this would be 10'094'700).
I assume that the MAX function in the measure is the problem?

How can I convert the measure so that the output per day is correctly summed to the month and year?

 

Matrix in PBI:

Christophe__0-1693665482567.png

 

Table "Output daily":

Item CodePlan actualYear
A260002023
B130002023
C47002023

 

Table "Daten":

DataYearWorking DayYYMM
01.01.2023202302301
02.01.2023202302301
03.01.2023202312301
04.01.2023202312301
05.01.2023202312301
06.01.2023202312301

 

I think i have found a solution by replacing MAX with SUM

 

Output 1 =
SUMX(
    'Daten',
    Daten[Working Day] * SUM('Output daily'[Plan actual])
)

That makes sense to me.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@Christophe_ Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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