cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wagrezy Helper I
Helper I

Manage Total and Subtotal with complex DAX formula - SUMX

Hi all

 

I created the following DAX formula which I am using in a table - the results are displayed by retailer and it can be filtered by market.

 

YTD 2018 (actual) = var maxweek = CALCULATE(MAX('SalesData'[Fiscal Week]),'SalesData'[Fiscal Year]=2019) RETURN IF(WEEKDAY(TODAY(),2)>1,CALCULATE([ActualSales],'SalesData'[Fiscal Year]=2018,'SalesData'[Fiscal Week]<maxweek),CALCULATE([ActualSales],'SalesData'[Fiscal Year]=2018,'SalesData'[Fiscal Week]<maxweek+1))
 
I know I have to use SUMX somewhere to ensure the calculation apply week by week but I tried different way and the results either do not change or become less relevant. Any help appreciated. Thanks
 
Yoann
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi @wagrezy 

 

If I have fixed your problem, please kindly mark my answer as a solution to finish the thread . thanks a lot!

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

7 REPLIES 7
Community Support
Community Support

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi @wagrezy 

 

You might consider creating pbix file that will contain some sample data, upload the pbix to onedrive or dropbox and share the link to the file. Please do not forget to describe the expected results based on this sample data.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
wagrezy Helper I
Helper I

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi and many thanks for your answer.

 

Pls find the link to a sample pbix where I recreated a simplest version of my issue.

 

The expected result would be the totals of the measure to be consistent with the sum of the measure by retailer which is not always the case - not in the view below for exemple.

 

Capture.PNG

 
Community Support
Community Support

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi @wagrezy 

 

I can't get the file coz the access limited, could you please share the file with the link anyone could edit it? I'd like to draw the answer to you.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
wagrezy Helper I
Helper I

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi

 

My organisation prevents me from sharing my onedrive document with external contacts.

Any other way to share?

 

thanks

Yoann

Community Support
Community Support

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi @wagrezy 

 

What about dropbox?

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Community Support
Community Support

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Hi @wagrezy 

 

If I have fixed your problem, please kindly mark my answer as a solution to finish the thread . thanks a lot!

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

wagrezy Helper I
Helper I

Re: Manage Total and Subtotal with complex DAX formula - SUMX

Great! Thanks a lot.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors