Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rdc_green
Frequent Visitor

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
Pragati11
Super User
Super User

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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.