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
PBIUser007
Frequent Visitor

Slicer to choose records with no data in fact table

Hi All,

 

I have a requirement to create a slicer based on Booking %. Given below are the tables used and the expected report output.

My report should show the dates without any bookings as well (checked show items with no data option for this).

 

Now I need to create a slicer which shows Booking% as 0% when no hours are booked in the fact table on a particular date. Since slicers does not accept measures, I need to crete a calculated column for booking% which should filter the dates which does not have any data in fact table on selecting 0% in the slicer. Does anyone have any idea on how to achieve this?

 

Tables Used:                                                                                                       

PBIUser007_0-1617125911649.png

Expected Report Output:

PBIUser007_1-1617126069028.png

 

Thanks in Advance

2 ACCEPTED SOLUTIONS
v-yangliu-msft
Community Support
Community Support

Hi  @PBIUser007  ,

Here are the steps you can follow:

Modify the data of the Date Table to look like this:

v-yangliu-msft_0-1617687135289.png

1. Click Transform data to enter power query, click merge queries as new, and leave Date Table and Resource Table as Left Outer.

v-yangliu-msft_1-1617687135312.png

Result:

v-yangliu-msft_2-1617687135316.png

2. Perform Left Outer on Merge1 Table and Bookings Table

v-yangliu-msft_3-1617687135321.png

Result:

v-yangliu-msft_4-1617687135325.png

3. Create calculated column.

Book% = 'Merge2'[BookingsTable.Hours Booked]/8

4. Select Book% in Merge2 as the slicer

5. Result:

v-yangliu-msft_5-1617687135328.png

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.

View solution in original post

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

View solution in original post

33 REPLIES 33
Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

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

Syndicate_Admin
Administrator
Administrator

Don't @PBIUser007,

This is an optimized and newly written method

Here are the steps you can follow:

1. Create a calculated table,

Table =
GENERATEALL(
    'Resource Table','Date Table')

result:

v-yangliu-msft_0-1617699745264.png

2. Create a calculated table.

Table 2 =
GENERATEALL(
    'Table',
    var _tableid='Table'[Resource ID]
    var _tabledate='Table'[date]
    return
    SELECTCOLUMNS(
        CALCULATETABLE('BookingsTable','BookingsTable'[Resource ID]=_tableid&&'BookingsTable'[Date]=_tabledate),
        "Hours Booked",'BookingsTable'[Hours Booked]))

3. Create a calculated column.

Book% = 'Table 2'[Hours Booked]/8

4. Use The Book% of Table2 as a cutter

5. Result.

v-yangliu-msft_1-1617699745278.png

You can download the PBIX file from here.

Best regards

Liu Yang

If this post helps, 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.