Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
I'm new to Power BI, and I'm working on this measure to show cumulative sum on specific time period.
The case and what I want:
I have one Calendar table [DateKey], and main data table [Data], they have relationship based on column date.
Show a visual of line & clustered column chart and a time slicer, in which show cumulative sum of revenue based on the slicer.
For eg: I have revenue table for January, I put out the DateKey[Month] column as slicer, when I choose January, the visual would show the cumulative sum of Revenue in July (from 1st to 31st July)
When I choose August, the visual would show cumulative sum Revenue in August (from 1st to 31st August)
What I did and try: I used the following DAX
Cumulative Sum Rev = CALCULATE(
SUM(Data[Revenue]),
FILTER(
ALL(Data),
Data[Date]<=MAX(Data[Date])
)
)
Actual outcome: It did create a cumulative sum line, but it was fine for July. If I choose August in slicer, it would be in continue from July. What I expected is the cumulative sum will begin from August, not from July.
I tried another solution, which is using ALLEXCEPT instead of ALL, but it does seems not working (you can see my measures in the pbix files already have it, but to filter another column [Lead_type], which works perfectly fine for another slicer)
Please help to show me where I was wrong.
Here is the link to my pbix file, it include what my visual would be and my measure:
https://1drv.ms/u/s!As4H0zrXywmbhaVFDprZ6RJmFUMbbg?e=l4Wxe5
Solved! Go to Solution.
Hi,
Use this measure
Hi,
Use this measure
Any particular reason for not using the built-in functions like TOTALMTD() ? Of course there are many ways to write that measure, but maybe start with the standard functions. Power BI offers "Quick Measures" that cover a wide range of frequently used patterns.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
89 | |
84 | |
76 | |
64 |
User | Count |
---|---|
136 | |
111 | |
98 | |
97 | |
92 |