Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi All,
I am trying to edit a quick measure that I have created. However, I am tryin to edit to include one more if condition - If(__DISTINCT_VALUES_COUNT is blank then say"All Job Roles" else execute the below code.
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('DEMO'[Job Role])
VAR __MAX_VALUES_TO_SHOW = 5
RETURN
IF(
__DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
CONCATENATE(
CONCATENATEX(
TOPN(
__MAX_VALUES_TO_SHOW,
VALUES('DEMO'[Job Role]),
'DEMO'[Job Role],
ASC
),
'DEMO'[Job Role],
", ",
'DEMO'[Job Role],
ASC
),
", etc."
),
CONCATENATEX(
VALUES('DEMO'[Job Role]),
'DEMO'[Job Role],
", ",
'DEMO'[Job Role],
ASC
)
)
However I am not able to add this condition(If(__DISTINCT_VALUES_COUNT is blank then say"All Job Roles"). I am using this in dynamic title. When the Job role slicer is selected All or no selection is made , then show "All Job role" else show the selected role in the dynamic title. Hope I am clear. Appreciate your help on this.
Hi @yogita
Can you provide some of the example data? As well as being the desired output, you can show it with a picture.
Best Regards
Hi @yogita , try using this:
Result=
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('DEMO'[Job Role])
VAR __MAX_VALUES_TO_SHOW = 5
Var new_variable=
IF(
__DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
CONCATENATE(
CONCATENATEX(
TOPN(
__MAX_VALUES_TO_SHOW,
VALUES('DEMO'[Job Role]),
'DEMO'[Job Role],
ASC
),
'DEMO'[Job Role],
", ",
'DEMO'[Job Role],
ASC
),
", etc."
),
CONCATENATEX(
VALUES('DEMO'[Job Role]),
'DEMO'[Job Role],
", ",
'DEMO'[Job Role],
ASC
)
)
Return
If(ISBLank(__DISTINCT_VALUES_COUNT), "All job roles" , new_variable)
@yogita -> please hit the thumbs up & mark it as a solution if it helps you. Thank you.
Hi Truptis, Thanks for your help. But this is not working. Because the slicer is set on Select All, I donot think that __DISTINCT_VALUES_COUNT will be blank.
User | Count |
---|---|
80 | |
74 | |
62 | |
61 | |
45 |
User | Count |
---|---|
108 | |
97 | |
88 | |
81 | |
61 |