Forum Discussion
Validate Slicer Selection
- 5 years ago
Anonymous here you go, add following measure
Month Selected = VAR __year = SUMMARIZE ( 'Calendar', [Year], "@Months", CONCATENATEX ( VALUES ( 'Calendar'[Month] ), [Month], "," ) ) VAR __status = IF ( COUNTROWS ( VALUES ( 'Calendar'[Year] ) ) = 1, -1, COUNTX ( SUMMARIZE ( __year, [@Months], "@Rowcount", COUNTROWS ( __year ) ), [@Rowcount] ) ) RETURN SWITCH ( __status, 1, "Valid Selection", -1, "Invalid Selecton - Only months selected in one year", "Invalid Selection - not same months selected" )Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would β€ Kudos if my solution helped. π If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
β‘Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.β‘
Anonymous here you go, add following measure
Month Selected =
VAR __year =
SUMMARIZE (
'Calendar', [Year], "@Months", CONCATENATEX ( VALUES ( 'Calendar'[Month] ), [Month], "," )
)
VAR __status =
IF ( COUNTROWS ( VALUES ( 'Calendar'[Year] ) ) = 1, -1,
COUNTX (
SUMMARIZE ( __year, [@Months], "@Rowcount", COUNTROWS ( __year ) ), [@Rowcount]
)
)
RETURN
SWITCH (
__status,
1, "Valid Selection",
-1, "Invalid Selecton - Only months selected in one year",
"Invalid Selection - not same months selected"
)
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would β€ Kudos if my solution helped. π If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
β‘Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.β‘