Forum Discussion
TODAY function
- 8 years ago
Hi sureshsonti,
The Service uses UTC time. Maybe you can try the formula below.
Yardage = IF ( UTCNOW () = NOW (), CALCULATE ( SUM ( YORX[Qty] ), FILTER ( 'YORX', 'YORX'[order_date] = DATEVALUE ( UTCNOW () + TIME ( 5, 0, 0 ) ) ) ), CALCULATE ( SUM ( YORX[Qty] ), FILTER ( 'YORX', 'YORX'[order_date] = TODAY () ) ) )
Hi sureshsonti,
That is odd - are you able to share the data model so that we can investigate? If the model contains sensitive data maybe you could remove it?
Thanks
Alex
This is my data model. Today's Volume will be showing 0 after 7 PM today.
Sch_Qty is what was ordered and Yardage is what was actually delivered
I used this statement by creating a new measure.
Yardage = CALCULATE(SUM(YORX[Qty]),FILTER('YORX','YORX'[order_date]=TODAY()))
So after 7 PM tonight it is showing tomorrow's orders. I am hiding some fields which are customer names and addresses.
My time zone is Central Standard Time (Baton Rouge, Louisiana)
- v-jiascu-msft8 years ago
Microsoft Employee
Hi sureshsonti,
I'm afraid I can't see from the snapshot that the measure shows tomorrow's orders.
1. Is it what you want or what it should be that "Today's Volume will be showing 0 after 7 PM today"?
2. Can you share a dummy sample of the original data?
3. Are there any wrong numbers in your snapshot?
Best Regards,
Dale
- sureshsonti8 years ago
Helper II
I am not able to attach a word file with screenshots.
My data has Order Date, and Units Produced which is Yardage. I just named it differently. But its the same field and I made a copy of the original field. Based on the Order Date power bi calculates Today's Yardage, MTD Yardage, and YTD Yardage.
On my workstation Power BI Desktop shows Today's Volume for Today till 11:59 PM and it changes to tomorrow at 12:00 AM which is what I want. But when I publish this data to Power BI Services after 7 PM on the same day the Today's Volume shows BLANK which means we didnt delivery or produce anything yet because that data is for Tomorrow. I am attaching a word document with screen shots
I will try to attach the screen shots
- v-jiascu-msft8 years ago
Microsoft Employee
Hi sureshsonti,
The Service uses UTC time. Maybe you can try the formula below.
Yardage = IF ( UTCNOW () = NOW (), CALCULATE ( SUM ( YORX[Qty] ), FILTER ( 'YORX', 'YORX'[order_date] = DATEVALUE ( UTCNOW () + TIME ( 5, 0, 0 ) ) ) ), CALCULATE ( SUM ( YORX[Qty] ), FILTER ( 'YORX', 'YORX'[order_date] = TODAY () ) ) )