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

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors