Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I want DAX formula for Divide,
it likes, Measure = No. of product / (no. of days between two dates - 1 - No. of Sundays in selected period)
Measure =
COUNT('Production of the day'[productshortname]) / (VALUES ( 'Production of the day'[actualendtime] )- 1 - no. of sundays)
how should i write Correct fromula for this.
Here is context of each term,
No. of product = COUNT('Production of the day'[productshortname]),
no. of days between two dates = (VALUES ( 'Production of the day'[actualendtime] ),
1 = totals selected no. of days minus 1 day (it is value not text),
No. of Sundays in selected period = no. of sundays( how should i write DAX for no. of Sundays only)
Solved! Go to Solution.
Hi
Just count the number of days without sundays, it is easier
Working Days =
CALCULATE(
COUNTROWS('Date Table'),
FILTER('Date Table',
Not WEEKDAY('Date Table'[Date],2) in {7}
)
)
Hi,
Please give some samples of your data. Thks
In the above image,
In Date, Both Date (01/09/2022) & (30/09/2022) are coming from same column
i.e. 'Production of the day'[actualendtime]
Below, J961 SH1599 C18 BL5
36.962 61.500 0.692 0.192
here for e.g. ,
J - Jeans(it is a product) , 961 - Total product count between 01/09/2022 & 30/09/2022,
36.961 = 961/(30-4) i.e. 30- total selected days & 4 - no. of sundays between selected days(01/09/2022)&(30/09/2022).
here is contect ,
Production of the day'[productshortname] = J
COUNT('Production of the day'[productshortname]) = 961
VALUES ( 'Production of the day'[actualendtime] ) = 30
no. of sundays i.e. 01/09/2022 & 30/09/2022 = 4
( how should i write DAX for no. of Sundays only between any selected date)
So I required DAX formula for 36.961 i.e 961/(30-4)
hope you get it.
Hi
Just count the number of days without sundays, it is easier
Working Days =
CALCULATE(
COUNTROWS('Date Table'),
FILTER('Date Table',
Not WEEKDAY('Date Table'[Date],2) in {7}
)
)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
21 | |
21 | |
19 | |
13 | |
12 |
User | Count |
---|---|
42 | |
28 | |
23 | |
22 | |
22 |