cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Slicer doesn't show options if data doesn't exist

I have the following slicer:

 

rdc_green_1-1603449755205.png

When i select an id linked to the slicer that doesn't have any data for 'Today' I get the following:

 

rdc_green_0-1603449715357.png

I would like the slicer to have all options no matter what id is selected.

 

This is the slicer query:

 

let
Source = let
TodaysDate = Date.From(DateTimeZone.FixedUtcNow()),
Ranges = {
{"Today",
TodaysDate,
TodaysDate,
1},
{"WTD",
Date.From(Date.StartOfWeek(TodaysDate)),
TodaysDate,
2},
{"MTD",
Date.From(Date.StartOfMonth(TodaysDate)),
TodaysDate,
3},
{"QTD",
Date.From(Date.StartOfQuarter(TodaysDate)),
TodaysDate,
4},
{"YTD",
Date.From(Date.StartOfYear(TodaysDate)),
TodaysDate,
5}
},
GetTables = List.Transform(Ranges,
each CreatePeriodTable(_{0}, _{1}, _{2}, _{3})),
Output = Table.Combine(GetTables)

in
Output
in
Source

 

with this function:

 

let
Source = (
PeriodName as text,
StartDate as date,
EndDate as date,
SortOrder as number
) as table =>
let
DayCount = Duration.Days(EndDate-StartDate)+1,
DateList = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),
AddPeriodName = List.Transform(DateList,
each {PeriodName,_,SortOrder}),
CreateTable = #table(
type table[Period=text, Date=date, Sort=number],
AddPeriodName)
in
CreateTable
in
Source

 

@MFelix - i have seen your answer on something like this before. Are you able to help with display of the slicer?

 

Thank you

1 ACCEPTED SOLUTION

Hello @rdc_green ,

Try to do this.

v-lionel-msft_0-1603694287957.png

Another way is to make the fields of the two slicers come from two unrelated tables.

Best regards
Lionel Chen

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

3 REPLIES 3
Super User III
Super User III

Hi @rdc_green ,

 

Turn interactions off for your slicer. Refer following:

https://www.wisdomaxis.com/technology/software/powerbi/interview-questions/what-is-the-default-visua...

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Unfortunatley I don't have the option to turn interactions off for that slicer:

rdc_green_0-1603451332956.png

Hello @rdc_green ,

Try to do this.

v-lionel-msft_0-1603694287957.png

Another way is to make the fields of the two slicers come from two unrelated tables.

Best regards
Lionel Chen

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors