Forum Discussion
reggiebob
1 year agoFrequent Visitor
Dynamic field based on subset
Hello, I am hoping someone can help me with what I am trying to accomplish. Please see my example below. I would like to display a column that indicates if the Contract is single site or mult...
- 1 year ago
Hi reggiebob ,
Add the following measures to your model:
Location % = DIVIDE( SUM(Sales[Sales]), CALCULATE( SUM(Sales[Sales]), REMOVEFILTERS(Customer[ShiptoCityState]) ) ) Site size = SWITCH( TRUE(), SELECTEDVALUE(Customer[Contract]) = BLANK(), "No Contract", MAXX( ALLSELECTED(Customer[ShiptoCityState]), [Location %] ) >= MIN('% Table'[% Value]), "Single Site", "Multi Site" ) Filter by site size = IF([Site size] in VALUES('Site size'[SiteSize]), 1)Use the measures on your visuals and the Filter by size should be placed on the filter pane for the specific visual with the option is not blank.
Please see attach file.
MFelix
1 year agoSuper User
Hi reggiebob ,
Add the following measures to your model:
Location % =
DIVIDE(
SUM(Sales[Sales]),
CALCULATE(
SUM(Sales[Sales]),
REMOVEFILTERS(Customer[ShiptoCityState])
)
)
Site size =
SWITCH(
TRUE(),
SELECTEDVALUE(Customer[Contract]) = BLANK(), "No Contract",
MAXX(
ALLSELECTED(Customer[ShiptoCityState]),
[Location %]
) >= MIN('% Table'[% Value]), "Single Site",
"Multi Site"
)
Filter by site size = IF([Site size] in VALUES('Site size'[SiteSize]), 1)
Use the measures on your visuals and the Filter by size should be placed on the filter pane for the specific visual with the option is not blank.
Please see attach file.
- reggiebob1 year agoFrequent Visitor
This worked perfectly! Thank you so much for your help. 😁