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, I'm new to the forum but I'll try to help you.
I don't know if I understand your query correctly.
You have that table that you show and what you want is to create another one from that if for example the date is > 01/01/2023?
You can do that with the CALCULATETABLE(nombre_tabla, nombre_tabla(date) function > 01/01/2023 )
I hope it serves you, greetings!
- Sarah-Barlow3 years agoFrequent Visitor
Hi, thank you for your reply. What I want is all PCN Names who updated their 'ALL' List in Jan 2023 combined with the PCN Names who last updated in say, December 2022 or November 2022, but not in January 2023 … hope that makes sense? Basically, I want to see the last update value
- Syndicate_Admin3 years agoAdministrator
So it would be something like that?
A table containing the PCN names ONLY from the last update?
If NCPs do not repeat (i.e. a PCN name always refers to the same), I would do the following.
SUMMARIZE(nombre_tabla,
PCN_name,
"PCN_ultimo", MAX(date)
)
See if such a solution works for you.- Sarah-Barlow3 years agoFrequent Visitor
What I need is a table that would look something like this (No repeated PCN Names, just the last update received):