Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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 No | Transaction Date | Delivery Date | Price |
1 | 01/01/2020 | 05/01/2020 | 100 |
2 | 03/01/2020 | 05/01/2020 | 150 |
3 | 03/01/2020 | 06/01/2020 | 200 |
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
Solved! Go to Solution.
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
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |