Forum Discussion
Support for maximum measurement calculation and obtaining adjacent data from a table.
- 3 years ago
Hi , Syndicate_Admin
Thanks for your screenshot sample data . According to your description, you want to get the max value per No.
Here are the steps you can refer to :
(1)This is my test data;
(2)We can create Three measures above it :
Max Tons = var _t = SUMMARIZE( ALLSELECTED('Table') , 'Table'[No.] ,'Table'[Buque] , 'Table'[Cliente] , 'Table'[Material] ,'Table'[Muelle],'Table'[Tipo Operation] , 'Table'[Fecha] , "Tons" , [Tons Desc Mat Measure] , "STD" , [STD Measure]) var _cur_no = MAX('Table'[No.]) var _t2 = FILTER( _t , [No.] =_cur_no) return MAXX(_t2 , [Tons])Max Material = var _t = SUMMARIZE( ALLSELECTED('Table') , 'Table'[No.] ,'Table'[Buque] , 'Table'[Cliente] , 'Table'[Material] ,'Table'[Muelle],'Table'[Tipo Operation] , 'Table'[Fecha] , "Tons" , [Tons Desc Mat Measure] , "STD" , [STD Measure]) var _cur_no = MAX('Table'[No.]) VAR _MAX_TONS= [Max Tons] var _t2 = FILTER( _t , [No.] =_cur_no && [Tons] = _MAX_TONS) return MAXX(_t2 , [Material])Max STD = var _t = SUMMARIZE( ALLSELECTED('Table') , 'Table'[No.] ,'Table'[Buque] , 'Table'[Cliente] , 'Table'[Material] ,'Table'[Muelle],'Table'[Tipo Operation] , 'Table'[Fecha] , "Tons" , [Tons Desc Mat Measure] , "STD" , [STD Measure]) var _cur_no = MAX('Table'[No.]) VAR _MAX_TONS= [Max Tons] var _t2 = FILTER( _t , [No.] =_cur_no && [Tons] = _MAX_TONS) return MAXX(_t2 , [STD])Then we can put the measures on the visual and we can get the result :
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. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
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
Thanks Dijo Zhang for your help !!!