Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi all,
I am trying the build a sales report and for one metric I would like to show the average tonnes sold per day. In order to do this, I need to embed a dynamic calculation in my calendar table that count the amount of working days (mon-fri) past in the current month. This calculation needs to reset itself every single month. On top of that, I would like to save the total working days in the month when the month has completed.
I cannot wrap my head around this and hope that one of you can help me out.
Thanks
Solved! Go to Solution.
[# Working Days] = // calculated column
var Today_ = TODAY()
var CurrentMonth = 'Calendar'[Year-Month]
var Result =
SUMX(
filter(
'Calendar'
// This filters to the whole month that
// is on the current line.
'Calendar'[Year-Month] = CurrentMonth
// This one says not to count anything
// that is in the future.
&& 'Calendar'[Date] <= Today_
),
'Calendar'[Is working day]
)
RETURN
// Add 0 to Result if you want to see
// 0 instead of BLANKS.
Result
Fantastic! That did the job. Thanks heaps
[# Working Days] = // calculated column
var Today_ = TODAY()
var CurrentMonth = 'Calendar'[Year-Month]
var Result =
SUMX(
filter(
'Calendar'
// This filters to the whole month that
// is on the current line.
'Calendar'[Year-Month] = CurrentMonth
// This one says not to count anything
// that is in the future.
&& 'Calendar'[Date] <= Today_
),
'Calendar'[Is working day]
)
RETURN
// Add 0 to Result if you want to see
// 0 instead of BLANKS.
Result
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
15 | |
14 | |
12 | |
9 |