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
Anonymous
Not applicable

QTD to Quater

Hi everyone!

 

I have QTD values in my table:

1 quater: 2

2 quater: 5

3 quater: 21

4 quater: 50

 

But it's cumulative values. So I'm trying trasform QTD to Quater values. And i want to get this:

 

1 quater: 2

2 quater: 3

3 quater: 16

4 quater: 29

 

Is there a way to do this?

 

Thanks,

Sava

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

Hi @Anonymous ,

 

I have rebuilt a data sample like this:

data sample.PNG

You could use the following formula to create a measure or column:

Measure = MAX('Table'[QTD])- CALCULATE(MAX('Table'[QTD]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1))
Column = [QTD]- CALCULATE(MAX('Table'[QTD]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1))

The final output is shown below:

output.PNG

Best Regards,
Eyelyn Qin
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-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

I have rebuilt a data sample like this:

data sample.PNG

You could use the following formula to create a measure or column:

Measure = MAX('Table'[QTD])- CALCULATE(MAX('Table'[QTD]),FILTER(ALL('Table'),'Table'[Index]=MAX('Table'[Index])-1))
Column = [QTD]- CALCULATE(MAX('Table'[QTD]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1))

The final output is shown below:

output.PNG

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

AllisonKennedy
Super User
Super User

@Anonymous  yes this can be done. You will need to create a calculated column in the table and use variables or EARLIER function to get the value from the previous quarter. Do you have an index or unique ID in your table? What does the raw data look like?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.