Forum Discussion
Measure Stop Filtering For Sub columns
- 5 years ago
Hi, selpaqm
Try to create a measure like this:
__Measure = VAR _customer = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Customer] = MAX ( 'Table'[Customer] ) ) ) VAR _brand = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Brand] = MAX ( 'Table'[Brand] ) ) ) RETURN DIVIDE ( _customer, _brand )result:
It is recommended to use percentage formatting, otherwise you will only see 0 or 1
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 5 years ago
measure1:
__divide = var _customer=CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[Customer]=MAX('Table'[Customer]))) var _brand=CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[Brand]=MAX('Table'[Brand]))) var _divide=DIVIDE(_customer,_brand) return _dividemeasure2:
_result = VAR _sum = SUMMARIZE ( 'Table', [Customer], [Brand], [Sales], "1", [__divide] ) RETURN SUMX ( _sum, [1] )result:
Best Regards,
Community Support Team _ Zeon Zheng
Hi, selpaqm
Try to create a measure like this:
__Measure =
VAR _customer =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Customer] = MAX ( 'Table'[Customer] )
)
)
VAR _brand =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Brand] = MAX ( 'Table'[Brand] ) )
)
RETURN
DIVIDE ( _customer, _brand )
result:
It is recommended to use percentage formatting, otherwise you will only see 0 or 1
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- selpaqm5 years agoHelper V
v-angzheng-msft thanks for reply works on table. when using a filter on slicer. it shows as 100% again. is there any solution for it? also total is not correct.
- v-angzheng-msft5 years agoCommunity Support
measure1:
__divide = var _customer=CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[Customer]=MAX('Table'[Customer]))) var _brand=CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[Brand]=MAX('Table'[Brand]))) var _divide=DIVIDE(_customer,_brand) return _dividemeasure2:
_result = VAR _sum = SUMMARIZE ( 'Table', [Customer], [Brand], [Sales], "1", [__divide] ) RETURN SUMX ( _sum, [1] )result:
Best Regards,
Community Support Team _ Zeon Zheng- selpaqm5 years agoHelper V
v-angzheng-msft it is really good working. thanks.