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.
Hi!
I can't seem to get the rolling total to work, even though I (at least I think I do) have used the variations of cumulative patterns from SQL BI guys, Chandeep and Enterprise DNA. Obviously there's something I'm missing here!
I get the date range as expected, but none of the patterns I have tried work. What's missing?
Hi @KrisD
Check this link:
https://www.vahiddm.com/post/weekly-time-intelligence-dax
Hi
Can you post sample data as text and expected output?
Not enough information to go on;
please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables
Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/
Hi, I've created a sample file with data, measures and desired result. --> https://easyupload.io/1okeq9
I got the WTD to work, I'm having issues with Previous month instead, which is defined in the file.
Hej,
For running total in a column the dax is a bit different. Try something like this:
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 and thanks for the swift reply!
Actually it's not supposed to be calculated as a column in this context, I made the table in DAX Studio in order to troubleshoot. The calculation is intended for a visual as per below picture, where I either get the total for all the rows, or only on row by row context. But no cumulative I'm afraid.
I see, in that case you could try removing the FILTER() in your CALCULATE. Now the FILTER filters a table where dates are smaller than the max date -> so all the dates and then it performs SUM operation -> SUM of all. This is the cause for your error. Referring to the SQLBI's example: https://www.sqlbi.com/articles/computing-running-totals-in-dax/
Proud to be a Super User!
Hi!
I appreciate your input, thank you!
The problem with your code is that do not have any external filters coming to the visual. The timeperiods are calculated by the use of SELECTEDVALUE.
The following is the complete code where I check if the user wants to see current week, current month, previous week and previous month.
Hi,
If you are using slicer to select Period you can use ALLSELECTED. Here my slicer is linked to calendar and my imaginary period only includes values from January:
Slicer not applied:
Applied:
Dax:
Proud to be a Super User!
Thanks for your time, but I'm not sure I follow.
Your code only works in a pre-defined context, like the table previously posted where the dates are already set?
I need to virtually create the table with the min and max date and do the running total in that context.
However, I tried your code in the measure and below is the input + results.
Hi @KrisD ,
According to your statement, I think All/Allselect function in code is correct ,if you want to calculate cumulative total.
Your measure logic looks correct. Sometimes it should look like as below.
cumulative total = calculate([Antal lastade ton],Filter(All(Table),[Date]<=Max([Date])))
However this measure should be based on [Antal lastade ton] as well. Could you share a sample without sensitive data with us and show us the result you want? This will make it easier for us to find the solution.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, sorry for delayed response. I'm attaching a sample file link because I could not find the option to attach it here. File --> https://easyupload.io/1okeq9
I got the WTD to work, I'm having issues with Previous month instead, which is defined in the file.
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |