Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have the formula
YTD_Cost = CALCULATE(COUNT('table'[cost]),DATESYTD('Date'[Date])
The formula correctly computes the count of all events for the current year.
I also have a formula that calculates LY YTD count of events which when i filter for a specific date range of this year. ie 01/05/2019 to 07/05/2019 it is showing the filtered amount of events for that date range last year.
Unfortunately, this year events is not filtering for the date range, but is showing a total count of all events that happened year to date.
Is there a formula to apply to count the values for the current year, so that when a filter is applied it shows that volume.
I want it to be setup so that each year it rolls over to show the current year data, without needing to make any changes to the formulas (ie. year=2019 to year = 2020)..
Solved! Go to Solution.
@Anonymous try following:
YTD_REDIRECTS = CALCULATE(COUNT('Table'[Event Type]),KEEPFILTERS(DATESYTD('Date'[Date]))
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous DATESYTD willl always count from Jan1 even you have filter applied and as the name suggest, it is Year to Date. I guess you are looking for if date filter is applied then use tht filter otherwise calculated ytd, is this correct understanding?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
That is correct @parry2k
I have tried both of these formulas
YTD_COSTS = TOTALYTD(COUNT('Table'[Cost]),'Date'[Date])
YTD_COSTS = CALCULATE(COUNT('Table'[Cost]),DATESYTD('Date'[Date])
I have a date slicer, and it allows me to slice backward from today and get a valid value, however if i slice from january 1st (ie. from february to may) the number it shows does not change to that date range, it stays as from start of year.
For the time being, i have got as a measure
@Anonymous try following:
YTD_REDIRECTS = CALCULATE(COUNT('Table'[Event Type]),KEEPFILTERS(DATESYTD('Date'[Date]))
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |