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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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
v-diye-msft
Community Support
Community Support

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.

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

 

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.

Hi

 

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

Any other way to share?

 

thanks

Yoann

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.

Great! Thanks a lot.

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.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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