Forum Discussion
Create Most Often field
- Anonymous3 years ago
Hi PBINewbie920 ,
Please try these measures:Primary Color % = VAR _customer = MAX('Table'[Customer]) VAR _color = MAX('Table'[Color]) VAR _count = CALCULATE ( COUNT ( 'Table'[Customer] ), FILTER ( ALL ( 'Table' ), 'Table'[Customer] = _customer && 'Table'[Color] = _color ) ) VAR _count_all = CALCULATE ( COUNT ( 'Table'[Customer] ), FILTER ( ALL ( 'Table' ), 'Table'[Customer] = _customer ) ) VAR _rate = DIVIDE ( _count, _count_all ) RETURN _rateFilter = VAR _max = MAXX(ALLEXCEPT('Table','Table'[Customer]),[Primary Color %]) VAR _result = IF([Primary Color %]=_max,1) RETURN _resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi PBINewbie920 ,
Please try these measures:
Primary Color % =
VAR _customer = MAX('Table'[Customer])
VAR _color = MAX('Table'[Color])
VAR _count =
CALCULATE (
COUNT ( 'Table'[Customer] ),
FILTER (
ALL ( 'Table' ),
'Table'[Customer] = _customer
&& 'Table'[Color] = _color
)
)
VAR _count_all =
CALCULATE (
COUNT ( 'Table'[Customer] ),
FILTER ( ALL ( 'Table' ), 'Table'[Customer] = _customer )
)
VAR _rate =
DIVIDE ( _count, _count_all )
RETURN
_rateFilter =
VAR _max = MAXX(ALLEXCEPT('Table','Table'[Customer]),[Primary Color %])
VAR _result = IF([Primary Color %]=_max,1)
RETURN
_result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data