The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I'm sorry, i'm sure the answer has been addressed again but from some quick search, i couldn't find it 😕
And TOTALYTD doesn't seem to do the trick for me.
So:
I'm trying to capture the sum of all [days] an employee was off sick from the beginning of the year until the slicer date.
Slicer Month:= CALCULATE(MIN('Leaves'[Month]))
CSP so far this year:= CALCULATE(SUMX('Leaves',IF('Leaves'[Month]<=[Slicer Month],[days],0)),ALL('Leaves'[Month Name]))
i've also tried
CSP so far this year:= CALCULATE(SUM([days]), ALL('Leaves'[Month Name]),FILTER('Leaves','Leaves'[Month]<=[Slicer Month]))
None of them returns the correct value.
I'm so confident the answer would be a "d-uh"! moment for me so apologies for my ignorance!
Many thanks in advance
Solved! Go to Solution.
Hi,
Here is one way to do this:
The example is a bit different but the base logic is the same. Ping me with @ if you have questions about it.I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi,
Here is one way to do this:
The example is a bit different but the base logic is the same. Ping me with @ if you have questions about it.I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
@ValtteriN that works perfect! many thanks! interested on your opinion, why my second measure above didn't work? The [Month] is just the number of the month, so is the slicer. Kind of happy to see that i wasn't miles away 😄
Thank you once again!
@kalspiros The key difference is that you used FILTER. FILTER creates a table filtered with the conditions while using filter conditions in CALCULATE modify the filter context.
Proud to be a Super User!
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
21 | |
14 | |
14 | |
9 | |
7 |