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
SkorpionAAM
Helper V
Helper V

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 
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

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)

1.PNG 

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

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

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)

1.PNG 

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

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@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]))))

No thtas not my Requirment 

@SkorpionAAM ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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.