Forum Discussion
estgas
8 years agoFrequent Visitor
SummarizeColumns with FirstNonBlank
Hi! I would like to create a new table that summarizes Prod. and Cust. depending on last Date (for both Prod. and Cust). Please see an example below. For the second Prod. there is the same date for...
- 8 years ago
Hi estgas
Go to Modelling Tab>>>>NEW TABLE
New Table = SUMMARIZE ( TableName, TableName[Prod.], "Last Date", MAX ( TableName[Date] ), "Last Date Customers", CALCULATE ( FIRSTNONBLANK ( TableName[Cust.], TableName[Cust.] ), FILTER ( TableName, TableName[Date] = MAX ( TableName[Date] ) ) ) ) - 8 years ago
Zubair_Muhammad
8 years agoCommunity Champion
Hi estgas
Go to Modelling Tab>>>>NEW TABLE
New Table =
SUMMARIZE (
TableName,
TableName[Prod.],
"Last Date", MAX ( TableName[Date] ),
"Last Date Customers", CALCULATE (
FIRSTNONBLANK ( TableName[Cust.], TableName[Cust.] ),
FILTER ( TableName, TableName[Date] = MAX ( TableName[Date] ) )
)
)
Zubair_Muhammad
8 years agoCommunity Champion
- estgas8 years agoFrequent Visitor
Many Thank Zubair! Exactly what I was looking for!
By the way I replaced SUMMARIZE with SUMMARIZECOLUMNS assuming that is preferred according to conclusion of https://www.sqlbi.com/articles/introducing-summarizecolumns/
- Zubair_Muhammad8 years agoCommunity Champion
HI estgas
Yes I believe
SummarizeColumns
or
combination of Summarize with AddColumns
is much faster than mere Summarize