Forum Discussion
mc_gadhzalova
2 years agoRegular Visitor
NUMERIC DISTRIBUTION - MEASURE ISSUE
Hi All, I have been struggling to create a measure to calculate numeric distribution. I need measure/s that calculate if a brand is avaliable in a store and then compared to the total number st...
- Anonymous2 years ago
Hi mc_gadhzalova ,
You can create a measure as below to get it, please find the details in the attachment.
BRAND DISTRIBUTION = VAR _tab = SUMMARIZE ( 'Table', 'Table'[COUNTRY], 'Table'[MONTH], 'Table'[STORE], 'Table'[BRAND], "@count", CALCULATE ( COUNT ( 'Table'[COUNTRY] ) , FILTER ( 'Table', 'Table'[COUNTRY] = EARLIER ( 'Table'[COUNTRY] ) && 'Table'[MONTH] = EARLIER ( 'Table'[MONTH] ) && 'Table'[STORE] = EARLIER ( 'Table'[STORE] ) && 'Table'[BRAND] = EARLIER ( 'Table'[BRAND] ) && 'Table'[EXISTS] = 1 ) ) ) VAR _count = COUNTX ( _tab, [@count] ) RETURN IF ( _count > 0, 1, 0 )Best Regards
Anonymous
2 years agoNot applicable
Hi mc_gadhzalova ,
You can create a measure as below to get it, please find the details in the attachment.
BRAND DISTRIBUTION =
VAR _tab =
SUMMARIZE (
'Table',
'Table'[COUNTRY],
'Table'[MONTH],
'Table'[STORE],
'Table'[BRAND],
"@count",
CALCULATE (
COUNT ( 'Table'[COUNTRY] ) ,
FILTER (
'Table',
'Table'[COUNTRY] = EARLIER ( 'Table'[COUNTRY] )
&& 'Table'[MONTH] = EARLIER ( 'Table'[MONTH] )
&& 'Table'[STORE] = EARLIER ( 'Table'[STORE] )
&& 'Table'[BRAND] = EARLIER ( 'Table'[BRAND] )
&& 'Table'[EXISTS] = 1
)
)
)
VAR _count =
COUNTX ( _tab, [@count] )
RETURN
IF ( _count > 0, 1, 0 )
Best Regards