Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Solved! Go to Solution.
Hi @learner03
Try this one
Closed within 48 Hrs =
VAR CurrentDate =
MAX ( 'Calendar'[Date] )
VAR Prev_Day =
CALCULATE (
MAX ( 'Calendar'[Date] ),
FILTER (
ALL ( 'Calendar' ),
'Calendar'[Date] < CurrentDate
&& 'Calendar'[If work day] = 1
)
)
VAR fortyeightHrs =
CALCULATE (
COUNT ( '3PL_Fulfilment'[Document Number] ),
ALL ( 'Calendar' ),
'Calendar'[Date] = Prev_Day,
'3PL_Fulfilment'[Completed in 48 hours] = "Yes"
)
RETURN
fortyeightHrs + 0
Your Trans_Previous_Day is a variable which already has a definite value before evaluating fortyeightHrs, as a result its value will not be changed when put in CALCULATE function.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @learner03
Try this one
Closed within 48 Hrs =
VAR CurrentDate =
MAX ( 'Calendar'[Date] )
VAR Prev_Day =
CALCULATE (
MAX ( 'Calendar'[Date] ),
FILTER (
ALL ( 'Calendar' ),
'Calendar'[Date] < CurrentDate
&& 'Calendar'[If work day] = 1
)
)
VAR fortyeightHrs =
CALCULATE (
COUNT ( '3PL_Fulfilment'[Document Number] ),
ALL ( 'Calendar' ),
'Calendar'[Date] = Prev_Day,
'3PL_Fulfilment'[Completed in 48 hours] = "Yes"
)
RETURN
fortyeightHrs + 0
Your Trans_Previous_Day is a variable which already has a definite value before evaluating fortyeightHrs, as a result its value will not be changed when put in CALCULATE function.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
@learner03 , this will have a problem if only one date is selected, try like
VAR Trans_Previous_Day =
CALCULATE(
COUNT('3PL_Fulfilment'[Document Number]), filter(all('Calendar') , 'Calendar'[Date] = Prev_Day))
refer last non continuous day
This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Work Date cont Rank]=max('Date'[Work Date cont Rank])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Work Date cont Rank]=max('Date'[Work Date cont Rank])-1))
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
@amitchandak can you please check the var fortyeighthrs line ,will it have count or count rows function as it is not counting number of rows where the value in column says "yes"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |