Forum Discussion
Single Select Slicer with Default Option
- Anonymous5 years ago
Hi Sonashish ,
You can use the isfiltered function
According to your description, I created some data:
Here are the steps you can follow:
1. Create measure to calculate the amount of a column when selecting a year
select_year = var _select=SELECTEDVALUE('Table'[Year]) return CALCULATE(SUM('Table'[amount]),FILTER('Table','Table'[Year]=_select))Result:
The default is blank ()
2. Use isfiltered to create measure. The default value is 2017
ISFILTERED = IF(ISFILTERED('Table'[Year]),'Table'[select_year],CALCULATE(SUM('Table'[amount]),FILTER('Table','Table'[Year]=2017)))Result:
The default value is 2017
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Sonashish ,
You can use the isfiltered function
According to your description, I created some data:
Here are the steps you can follow:
1. Create measure to calculate the amount of a column when selecting a year
select_year =
var _select=SELECTEDVALUE('Table'[Year])
return CALCULATE(SUM('Table'[amount]),FILTER('Table','Table'[Year]=_select))Result:
The default is blank ()
2. Use isfiltered to create measure. The default value is 2017
ISFILTERED =
IF(ISFILTERED('Table'[Year]),'Table'[select_year],CALCULATE(SUM('Table'[amount]),FILTER('Table','Table'[Year]=2017)))Result:
The default value is 2017
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Liu, I implemented your implementation. It seems to be working.
Thanks