Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Revenue Year to Date

Hello!  I am having difficulty making a dax formula to create a revenue year to date.  Attached is the code that I have and tables that I have as well.  Thanks in advance! 

 

Dax:

Revenue YTD =
TOTALYTD([Revenue], 'public view_transactions'[date].[Date])
 
Revenue = sum('public view_transactions'[line_amount])
 
 
Tables[columns]:
transactions [date, line_amount]
 
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Revenue YTD =
TOTALYTD([Revenue], 'public view_transactions'[Date])
 
This code seems to be working

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Revenue YTD =
TOTALYTD([Revenue], 'public view_transactions'[Date])
 
This code seems to be working
Anonymous
Not applicable

I had this working about a week ago, but it just recently stopped working. I have a column in a table already that's joined properly that has date in it.  I shouldn't have to create ANOTHER date table.  

 

Revenue = sum('public view_transactions'[line_amount])
 
Revenue YTD =
TOTALYTD([Revenue], 'public view_transactions'[date].[Date])

 

nattiej101_0-1617112498201.png

 

Anonymous
Not applicable

nattiej101_0-1616594832552.png

 

So it's coming in and not giving me an error, it's just blank.  But I have about 2 million lines of data in my report.

 

Hi @Anonymous ,

 

You should create a calendar table first.

Please refer to my .pbix file.

v-lionel-msft_0-1616744038780.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , do not use [Date].Date, In case your date have timestamp, create a new date

 

New Date = [Date].date
or
New Date = date(year([Date]),month([Date]),day([Date]))

 

Then join this date with date table and use time intelligence

TOTALYTD([Revenue], 'Date'[Date])

 

Refer to my Video, Why TI Fails : https://youtu.be/OBf0rjpp5Hw

Anonymous
Not applicable

It's not letting me create a measure of a new column in the table for that.  I even changed the query to be date instead of a date with a timestamp.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.