Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
talkprem
Frequent Visitor

Cumulative Sum is not giving correct results

Hello,

 

I am currently trying to get cumulative sum of my sample data as in picture. but instead of Cumulative Variance and Cumulative Sales i am getting same as the normal variance and Cumulative sales. I have pasted my DAX code as well but it is not working.
I have slicers on datetime,pharmaid,base,base group (currently only datetime and pharma id are selected)

PJ_20231013_142814674~2.jpg

 

This is the dax formaula used for Cumulative variance and Sales - 

 

Cumulated Variance =
CALCULATE (
SUM (Table1'[Variance]),
FILTER(ALLSELECTED(Table1[DateTime],Table1[pharmaSiteld]),
 Table1[DateTime] <=MAX(Table1[DateTime])
)

 

Can someone please help me 

4 REPLIES 4
PurpleGate
Resolver III
Resolver III

Try

CALCULATE(
    COUNTA('Table1'[Variance]),
    FILTER(
        ALLSELECTED('Table1'[DateTime]),
        ISONORAFTER('Table1'[DateTime], MAX('Table1'[DateTime]), DESC)
    )
)

This is Giving all rows as 1 in cumulative sum. Can you please try once more?

Ok, I guess you should use Sum instead of Count. 

 

Or if your Variance column is already a measure, then just use that instead.

Yes i have already given my DAX formula, but it is not giving the cumulative sum i need. can someone please help on this.
I have been trying for 2 days and still got no solution.
Instead of cumulative sum i am getting same value as variance column.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors