Forum Discussion
Create a Filter from 8pm Yesterday through 8am today
- 3 years ago
MA_guy_VER Try:
Measure = VAR __Today = TODAY() VAR __Yesterday = __Today - 1 VAR __Table = FILTER('Table', ( [Date] = __Yesterday && [Time] >= 80000 ) || ( [Date] = __Today && [Time] <= 200000) ) RETURN SUMX(__Table,[Qty Picked]) - 3 years ago
I think Greg got the hours reversed. Please re-try with this:
Measure = VAR __Today = TODAY() VAR __Yesterday = __Today - 1 VAR __Table = FILTER('Table', ( [Date] = __Yesterday && [Time] >= 200000 ) || ( [Date] = __Today && [Time] <= 80000) ) RETURN SUMX(__Table,[Qty Picked]) - 3 years ago
Yes, we are assuming your [Date] Column is a Date Field. It looks to be more like a DateKey.
So, in this case we need to convert the VAR _Today into a similar DateKey:
VAR _Today = YEAR( Today() ) & MONTH( Today() ) & DAY( Today() ) VAR _Yesterday = _Today - 1Ensure your Date Column above is numeric
Hi , MA_guy_VER
You can use this dax to try to replace the date format:
Measure 1 = YEAR( Today() )*10000 + MONTH( Today() ) *100 + DAY( Today() ) & ".00"
The result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
v-yueyunzh-msft That worked after I removed the ".00" from the end. Cheers!