Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
Edit: Along with the solution I also identified another mistake I made. There was a mismatch between the formatting of my date table and the date column in my fact table (date/time vs date). This cause the relationship between my tables to be crossfiltered instead of being a single one to many -> which in turned made the functions not work.
I have browsed several posts about how to set up a cumulative sum function in the hopes of managing to create one myself, however it does not provide me with the correct output and I am struggling with understanding where I am going wrong.
This is my current formula where OversiktKurs is my Table and [Deltagere Kurs] is the column I would like to calculate the cumulative sum for. I have created a separate date table (dDate), where [Date] has every single date from the start till the end of my fact table. I have also created a relationship between my date table and fact table.
Thank you in advance for your help,
Renate
Solved! Go to Solution.
Hi Renate,
Try this as a measure instead, making sure to use dDato fields in visuals, not fact table dates:
_cumulativeSum =
VAR __cDate = MAX(dDato[Date])
RETURN
CALCULATE(
SUM(OversiktKurs[Deltagere kurs]),
FILTER(
ALLSELECTED(dDato),
dDato[Date] <= __cDate
)
)
Pete
Proud to be a Datanaut!
Hi Renate,
Try this as a measure instead, making sure to use dDato fields in visuals, not fact table dates:
_cumulativeSum =
VAR __cDate = MAX(dDato[Date])
RETURN
CALCULATE(
SUM(OversiktKurs[Deltagere kurs]),
FILTER(
ALLSELECTED(dDato),
dDato[Date] <= __cDate
)
)
Pete
Proud to be a Datanaut!
Hello Pete,
Thank you for the formula!
It seems I may have created a circular dependency as my Date table is created and based on the dates in my fact table;
Hi Renate,
There's no need to swap out anything in the measure I gave you. It should work exactly as it is.
Please try the measure exactly as I wrote it and let me know how you get on.
Pete
Proud to be a Datanaut!
I am receiving a circular dependency error - I fear it may be due to how I created my date table.
Are you trying to create this as a calculated column rather than a measure?
You shouln't get a circular dependency when creating a measure as your dDato table would not get recalculated at thatpoint.
Pete
Proud to be a Datanaut!
You are correct, it completely slipped my mind.
It worked now, thank you so much for your help.
Best regards,
Renate
Thank you for the response, I tried to use the EARLIER function, but I am receiving an error saying that "the syntax for date is wrong" and the error message ending with 6 parenteses instead of 3.
If I try to use it without .Date
I get the error "A single value for column 'Tangoe Owner Email' in table 'Monthly Billing' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
72 | |
65 | |
42 | |
28 | |
21 |