Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone !
I have the following scenario where I need to calculate the YTD value for each channel.
However, for the january, I don't usually have the data for all the channels so when using TOTALYTD, it calculates the YTD of the previous year for some channels year whereas I would like to use the max last avaibale date for all the channels
Instead, I'm using CALCULATE function along with DATESBETWEEN to get the desired output and I was wondering if there is a different way to do it.
Here is my formula and in comments the section that i don't use anymore
And here is the result when using TOTALYTD:
As you can see when using the TOTALYTD function, it returns values for all channels, however, it's supposed to only return 11 for "Face to Face" channel since my last avaib date in my table is January and I would like to display the results only for january.
I guess I could change my formula to check if there is no data for the latest available month then return a 0 else use the TOTALYTD formula as showen bellow but I'm still curious if there is another way to use TOTALYTD to "force" a certain context
Looking forward to your replies,
Cheers,
Mariem
Hi @Anonymous ,
I created some data:
1. You can directly specify the date to get YTD
Measure =
CALCULATE(SUM('date'[amount]),FILTER('date','date'[date]>=date(YEAR(TODAY()),1,1)&&'date'[date]<=TODAY()))
2. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Can you share the dummy pbix to resolve it!
Proud to be a Super User!
Hi @VijayP
I have tried that and it didn't work, here's how i changed my formula:
@Anonymous
in TOTALYTD try using Year End Date argument , to specify where you Data to end
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |