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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
QwkInsightsTech
New Member

YTD without a date field specified

Hi All,

 

I am experimenting with DAX and SSAS Tabular and I have an issue which I can't seem to solve. Imagine the following data:

 

Order NoTransaction DateDelivery DatePrice
101/01/202005/01/2020100
203/01/202005/01/2020150
303/01/202006/01/2020200

 

To model the above I created 2 role playing date tables, one for the transaction date and one for the delivery date and I connected both of these tables to the sales fact.

 

To show the YTD values, I created 2 measures as follows:

YTD Sales by Tran Date:= CALCULATE(SUM('Sales'[Price]) ,DATESYTD('Transaction Date'[Date]))

and

YTS Sales by Delivery Date:= CALCULATE(SUM('Sales'[Price]) ,DATESYTD('Delivery Date'[Date]))

 

However ideally I would have 1 measure for YTD sales. Is there a way I can create a single measure named YTD sales and the value is calculated according to which date the user selects? From what I read so far it seems that the time functions all need a date specified to work.

 

Thanks

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @QwkInsightsTech 

You could create another measure that calls on one the measures you already have depending on the user selection. If you have slicers on those two date tables, you can check which one has been selected by the user, with ISFILTERED( ) for instance and decide what measure to invoke accordingly.

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @QwkInsightsTech 

You could create another measure that calls on one the measures you already have depending on the user selection. If you have slicers on those two date tables, you can check which one has been selected by the user, with ISFILTERED( ) for instance and decide what measure to invoke accordingly.

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.