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
Enric21
Frequent Visitor

Get sales value from the latest version of a project

Hi legends, 

 

I hope somebody can help me. 

 

I have been struggling with getting the amount of sales of the latest version of certains projects. I have a table whith diferent projects an those projects have diferent versions (going from 0 to 5) and I would like to make a new table filtering only the amount of sales refering at the latests version of each project. 

 

Here you have an example table:

 

Project IDVersionSales
1010
1020
11100
1230
1240
2015
2070
2115
2120
2115
3020
3150
3230

 

And here what I would like to get: 

 

Project IDVersionSales
1270
2150
3230

 

As you can see, project 1 have three versions (0, 1 and 2) and I am only interested in the last one (version 2).

 

Thank you very much.

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Enric21 

 

If you want a DAX method, you can first create a new table with below code:

Table 2 = SUMMARIZE('Table','Table'[Project ID],"Version",MAX('Table'[Version]))

Then add a new column in this table 

Sales = SUMX(FILTER('Table','Table'[Project ID]='Table 2'[Project ID]&&'Table'[Version]='Table 2'[Version]),'Table'[Sales])

21102501.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @Enric21 

 

If you want a DAX method, you can first create a new table with below code:

Table 2 = SUMMARIZE('Table','Table'[Project ID],"Version",MAX('Table'[Version]))

Then add a new column in this table 

Sales = SUMX(FILTER('Table','Table'[Project ID]='Table 2'[Project ID]&&'Table'[Version]='Table 2'[Version]),'Table'[Sales])

21102501.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hi @v-jingzhang 

 

Thanks again for your accurate response. 

 

I have now another challenge that I cannot solve regarding the same table. 

 

The point is, my table in addition to projects it also has chapters, so each project has many chapters. The created table following your instructions gave me the total amount of the latest version of each project as I asked for, but now I would like to know how to make that table (or another one) taking into account those chapters as well. So as an example the original table is like: 

 

Project IDVersionChapterSales
1001.0110
1001.0115
1101.0115
1101.0220
1101.0215
1201.0130
1201.0130
1201.0250
2001.0120
2001.0220
2101.01100
2101.0240
2101.0270

 

And the result I would like to get would be like: 

 

Project IDVersionChapterSales
1201.0160
1201.0250
2101.01100
2101.02110

 

Thank you very much in advance

Hi @Enric21 

 

Sorry for the late reply. I transform the table to get this result in Power Query editor. Download the attachment to see the transformation steps there. 

21110204.jpg

 

If you just want to achieve this expected output in a table visual in report and don't want to transform the original table structure, we can also create measures to do that. Let me know what you prefer.

 

Regards,

Jing

Many thanks Jing, 

 

I replied your transformation steps and works perfectly. 

 

Regards, 

 

Enric.

Hi @v-jingzhang 

 

Thank you very much for your response. This is the solution I was looking for. 

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.