Forum Discussion
Create table from another table with conditions
- 3 years ago
Hi , Sarah-Barlow
According to your description, you want to get a table that has the only one [PCN_Name] and the only one max of [Effective_Snapshot_Date]. And the corresponding [ALL] value.
Here are the steps you can refer to :
(1)This is my test data:(2)We can click "New Table" and enter this:
Table 2 = ADDCOLUMNS( SUMMARIZE('Table','Table'[PCN_Name] , "Effective_Snapshot_Date" ,CALCULATE( MAX('Table'[Effective_Snapshot_Date]))) , "ALL" , CALCULATE( SUM('Table'[ALL]),TREATAS({[Effective_Snapshot_Date]},'Table'[Effective_Snapshot_Date]),TREATAS({[PCN_Name]},'Table'[PCN_Name])))(3)Then we can meet your need , the result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , Sarah-Barlow
According to your description, you want to get a table that has the only one [PCN_Name] and the only one max of [Effective_Snapshot_Date]. And the corresponding [ALL] value.
Here are the steps you can refer to :
(1)This is my test data:
(2)We can click "New Table" and enter this:
Table 2 = ADDCOLUMNS( SUMMARIZE('Table','Table'[PCN_Name] , "Effective_Snapshot_Date" ,CALCULATE( MAX('Table'[Effective_Snapshot_Date]))) , "ALL" , CALCULATE( SUM('Table'[ALL]),TREATAS({[Effective_Snapshot_Date]},'Table'[Effective_Snapshot_Date]),TREATAS({[PCN_Name]},'Table'[PCN_Name])))
(3)Then we can meet your need , the result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you!