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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
shashed
Frequent Visitor

TotalQTD,TotalMTD not working as expected

My data is weekly and has multiple 'type'. For date variable, I have created a 'date' column with start of each week. 

Sample Data:

shashed_0-1665582852136.png

 

My objective is to get MTD/QTD for each of the type separately and so tried to use the following DAX:

 

shashed_1-1665583077393.png

 

I have tried by having Date table separately as well and creating a relationship using week_id, but the outcome (new column) is  same as follows: (i.e. it is not summing up)

 

shashed_2-1665583168383.png

 expected outcome:

shashed_4-1665583385597.png

 

If someone can guide me with the above regards, that'd really helpful!

 

 

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @shashed ,

 

Please try following DAX to create a new column:

 

Expected qtd = CALCULATE(SUM('Table'[Value]),FILTER('Table', 'Table'[Week] <= EARLIER('Table'[Week]) && 'Table'[Type] = EARLIER('Table'[Type]) && 'Table'[Quarter] = EARLIER('Table'[Quarter])))

 

vyadongfmsft_0-1665637694504.png

 

Best regards,

Yadong Fang

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

2 REPLIES 2
v-yadongf-msft
Community Support
Community Support

Hi @shashed ,

 

Please try following DAX to create a new column:

 

Expected qtd = CALCULATE(SUM('Table'[Value]),FILTER('Table', 'Table'[Week] <= EARLIER('Table'[Week]) && 'Table'[Type] = EARLIER('Table'[Type]) && 'Table'[Quarter] = EARLIER('Table'[Quarter])))

 

vyadongfmsft_0-1665637694504.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This works! Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.