Forum Discussion

SkorpionAAM's avatar
SkorpionAAM
Helper V
5 years ago
Solved

All data from Master to New table

I have master table which i need to create new table .. master data have 5648 Row and i need only Max date data which is 2056 or row will be ncrease dauly bases im using DAX function where i can get Max data from master bt in need new table where i can copy max data (2056) one to new table is there any possibilty to do this 

 

here is Dax funtuin for measure 

 

Total Open = var openx =
VAR __Table =
ADDCOLUMNS(
SUMMARIZE('GasStation',[place_digital_adress],"Date",MAX('GasStation'[date])),
"Status",MAXX(FILTER('GasStation',[place_digital_adress]=EARLIER([place_digital_adress])&&[Date]=EARLIER([Date])),[STATUS_OF_STATION])
)
RETURN
COUNTROWS(FILTER(__Table,[Status]="مفتوح"))

return
IF(ISBLANK(openx),"0",openx)
 
 
i need all columns and rows 
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi SkorpionAAM ,

     

    You could create a calculated column as flag for the master table to mark the rows which have max date then create a new table to filter these data by this flag.

    Column = 
    var max_date = MAXX(ALL('Table'),'Table'[date])
    return
    IF('Table'[date]=max_date,1,0)

     

    Table 2 = FILTER('Table','Table'[Column]=1)

     

    Best Regards,

    Jay

4 Replies

  • SkorpionAAM , see like you are creating a measure try a measure like

     

    Measure =
    VAR __id = MAX ('GasStation',[place_digital_adress])
    VAR __date = CALCULATE ( MAX('Table'[date] ), ALLSELECTED ('GasStation' ), 'GasStation',[place_digital_adress] = __id )
    CALCULATE ( COUNTROWS ('GasStation'), VALUES ('Table'[place_digital_adress] ),'GasStation',[place_digital_adress] = __id,'GasStation'[date] = __date )

     

    or

     

    measure = calculate(COUNTROWS ('GasStation'), filter(GasStation,GasStation[Date] = calculate(max(GasStation[Date]), allexpcept(GasStation,GasStation[place_digital_adress]))))

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi SkorpionAAM ,

     

    You could create a calculated column as flag for the master table to mark the rows which have max date then create a new table to filter these data by this flag.

    Column = 
    var max_date = MAXX(ALL('Table'),'Table'[date])
    return
    IF('Table'[date]=max_date,1,0)

     

    Table 2 = FILTER('Table','Table'[Column]=1)

     

    Best Regards,

    Jay