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.
Here is a screenshot of my visual:
The dark blue columns should be a running total of the light blue columns. The green figures are the correct values for the second and third running total value but you can see that the running total is just the running total for each individual period. I am trying to calculate the running by summing the transactions between the date chosen on the slider and the last date of each period. So the second set of columns should be the sum of the transactions between 11/25/2020 and 01/02/2022.
Here is the Dax code for my running total column:
I added the ALL function (in orange) to my original code but it did not change a thing. How do I get the Dax to start at the date selected in the slicer rather than the start date of the period without changing anything else?
Thanks
Hi @RandyShroyer ,
From your screenshot, I see that you put the date period in your axis, and you also have a calendar table called dimDate, right?
Does your main table have a relational connection with the calendar table?
It's the best that you provide your sample data. Dummy data is also available.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thaks for your interest!
Yes the X axis is a date from our date table (dimDate). And it does have a relationship with the fact table.
I have found a different way to achieve what I want by modifying a posted solution for a different problem. But it required adding some extra columns and would prefer to calculate the running total "in" the visual.
Read about filter context. You use ALL() but then you replace that again with the measure's context. Using RELATED in measures is tricky. Try something like this:
TESTRunningTotal =
var first = [FirstDateInData]
CALCULATE (SUM (factUtilization[ITEM_UNITS]),
factUtilization[dteSERVICE_DATE] >= first,
factUtilization[dteSERVICE_DATE] <= dimDate[PayPeriodEndDate]
)
Thanks for your interest! Unfortunately, your suggestion gave the same results as my own.
The running total always equals the amount in the individual periods rather than being a total of the current period activity and everything that comes after it. The data is filtered by the X axis so I can't get at the data prior to the current period.
Sorry, that should be "everything that comes before it"
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 |
---|---|
106 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |