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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
PijushRoy
Super User
Super User

DAX for Cumulated total required Product and Month wise

Hi Team,

I have DataTable and Calendar table. In DataTable, I don't have a date column.
I need to show Months wise and Product wise Cumulative sales total per year.

My fiscal year from JULY to JUNE

I have created another Calendar Table for Cumulative total and relationship.

 

In the below screenshot, you can find wrong data is coming

01.JPG

 

The calculation I am using for Specific year wise

FY21_Cumm_Sales = 
VAR _Sales = CALCULATE(SUM('DataTable'[SalesFY21]),
            FILTER(ALLEXCEPT('DataTable','DataTable'[Product]),
            'DataTable'[Fiscal_MonthNo] <= MAX('DataTable'[Fiscal_MonthNo])))
VAR _SelectedMonth = SELECTEDVALUE(Calnedar[Calendar_MonthNo])
RETURN
CALCULATE(_Sales, CROSSFILTER(Calnedar[Fiscal_MonthNo],'DataTable'[Fiscal_MonthNo],None),
FILTER('Calender for Commulative','Calender for Commulative'[Fiscal_MonthNo] >= _SelectedMonth))

 

Please find the PBIX file. and Expected Result file in Excel

 

YOUR HELP IS HIGHLY APPRECIATED, THANKS




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





2 ACCEPTED SOLUTIONS
negi007
Community Champion
Community Champion

@PijushRoy I have created a date field in your both date and data table to link the table

negi007_0-1672065779234.png

and then below measure can help to calc ytd value

 

TotalYTD_Vol = TOTALYTD(SUM('DataTable'[Amount]),Calnedar[Date],ALL(Calnedar[Date]),"Jun 1")



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

HI @PijushRoy and @negi007 
There are two solutions in the attached file, mine and @negi007 , take a look and decide which one suits you better. 
You can accept both my decision and @negi007 
Screenshot_24.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

6 REPLIES 6
PijushRoy
Super User
Super User

Thanks @DimaMD @negi007 
Both solutions are working




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





negi007
Community Champion
Community Champion

@PijushRoy I have created a date field in your both date and data table to link the table

negi007_0-1672065779234.png

and then below measure can help to calc ytd value

 

TotalYTD_Vol = TOTALYTD(SUM('DataTable'[Amount]),Calnedar[Date],ALL(Calnedar[Date]),"Jun 1")



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

DimaMD
Solution Sage
Solution Sage

Hi @PijushRoy  see the attached file, I have made changes to your measure

FY23_Cumm_Sales = 
VAR _Sales = CALCULATE(SUM('DataTable'[SalesFY23]),
            FILTER(ALLEXCEPT('DataTable','DataTable'[Product]),
            'DataTable'[Fiscal_MonthNo] <= MAX('DataTable'[Fiscal_MonthNo])))
VAR _SelectedMonth = MIN('DataTable'[Fiscal_MonthNo])
RETURN
CALCULATE(_Sales, 
FILTER('DataTable','DataTable'[Fiscal_MonthNo] <= _SelectedMonth))


Screenshot_23.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Hi @DimaMD 

 

Yes, it is working when taking slicer value from DataTable.
But I can't take slicer form DataTable because I have other visual in same page and common slicer from Calender table.

I am facing same issue, any way to solve this?

 

Thanks for your reply




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





HI @PijushRoy and @negi007 
There are two solutions in the attached file, mine and @negi007 , take a look and decide which one suits you better. 
You can accept both my decision and @negi007 
Screenshot_24.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

@PijushRoy did you try the solution suggested by me.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.