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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
LoNiCho
Regular Visitor

lookup

I have a database with costs related to products

Product  SubProduct            Manufact_Cost      Package_Cost  Delivery_Cost

1                     A                                15                      20                     20

1                     B                                16                      25                     22

1                     C                                14                      22                     28

2                     A                                16                      10                     20

2                     B                                12                      15                     25

2                     C                                11                      10                     20

3                     A                                25                     14                     10

3                     B                                27                      15                     14

3                     C                                22                      15                     10

 

But I've been asked to have a filter by the Cost Type, so selecting Manufacturing, Package and Delivery, so one or multiple of these can be selected and displayed, summing over product or subproduct.

 

I have set up an indexed table called Cost Type to use as a filter but how do I lookup from my Fact table to my cost type table .

Index  CostType

1         Manufact_Cost

2         Package_Cost  

3         Delivery_Cost

 

Many thanks,

 

LoNiCho

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @LoNiCho

 

To have a filter by the Cost Type, you create the cost type table and you need relate the Fact table with the cost type table.

This also made me stuck in, fortunately, I find another method to achieve your goal.

 

The formula below will create a new table based on the fact table you provided, then we can have a filter by the Cost Type.

 

 
Table =
VAR table1 =
    SUMMARIZE (
        Sheet1,
        [Product ],
        [SubProduct],
        [Delivery_Cost],
        "Cost Type", IF ( [Delivery_Cost] <> BLANK (), "Delivery_Cost" )
    )
VAR table2 =
    SUMMARIZE (
        Sheet1,
        [Product ],
        [SubProduct],
        [Manufact_Cost],
        "Cost Type", IF ( [Manufact_Cost] <> BLANK (), "Manufact_Cost" )
    )
VAR table3 =
    SUMMARIZE (
        Sheet1,
        [Product ],
        [SubProduct],
        [Package_Cost],
        "Cost Type", IF ( [Package_Cost] <> BLANK (), "Package_Cost" )
    )
RETURN
    UNION ( table1, table2, table3 )
5.png
6.png
 
 
Best Regards
Maggie

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @LoNiCho

 

To have a filter by the Cost Type, you create the cost type table and you need relate the Fact table with the cost type table.

This also made me stuck in, fortunately, I find another method to achieve your goal.

 

The formula below will create a new table based on the fact table you provided, then we can have a filter by the Cost Type.

 

 
Table =
VAR table1 =
    SUMMARIZE (
        Sheet1,
        [Product ],
        [SubProduct],
        [Delivery_Cost],
        "Cost Type", IF ( [Delivery_Cost] <> BLANK (), "Delivery_Cost" )
    )
VAR table2 =
    SUMMARIZE (
        Sheet1,
        [Product ],
        [SubProduct],
        [Manufact_Cost],
        "Cost Type", IF ( [Manufact_Cost] <> BLANK (), "Manufact_Cost" )
    )
VAR table3 =
    SUMMARIZE (
        Sheet1,
        [Product ],
        [SubProduct],
        [Package_Cost],
        "Cost Type", IF ( [Package_Cost] <> BLANK (), "Package_Cost" )
    )
RETURN
    UNION ( table1, table2, table3 )
5.png
6.png
 
 
Best Regards
Maggie

Thank you Maggie that looks great.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.