Forum Discussion
Choose two columns based on max value
- 6 years ago
Hi plugwater ,
Maybe you need to change the DAX format because of different regions.
Measure = VAR max_value = CALCULATE ( MAX ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ) VAR ct = CALCULATE ( FIRSTNONBLANK ( 'Table'[Category], 1 ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), 'Table'[Value] = max_value ) ) RETURN IF ( MAX ( 'Table'[Value] ) = max_value && MAX ( 'Table'[Category] ) = ct, 1, 0 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Liang,
Thanks.
It seems the formula has some issues - A single value for column cannot be determined
Aggregate by PL is the value/amount.
Hi plugwater ,
Based on the sample data you provided, the pbix I created can get the expected results. You can download the pbix I provided for comparison and find out the issue.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- V-lianl-msft6 years agoCommunity Support
Hi plugwater ,
Maybe you need to change the DAX format because of different regions.
Measure = VAR max_value = CALCULATE ( MAX ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ) VAR ct = CALCULATE ( FIRSTNONBLANK ( 'Table'[Category], 1 ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), 'Table'[Value] = max_value ) ) RETURN IF ( MAX ( 'Table'[Value] ) = max_value && MAX ( 'Table'[Category] ) = ct, 1, 0 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - plugwater6 years agoFrequent Visitor
Please provide access to download the pbix file.
User can't be found in the qiuyunus-my.sharepoint.com directory