Forum Discussion

Yoshimitsu411's avatar
Yoshimitsu411
Icon for Resolver I rankResolver I
5 years ago
Solved

How to Slice One Fact Table with Two Dimensional Tables?

Hello

 

Below is my current model. I need to filter the Costs table by a Work Group slicer which is a combination of Work Group values from the Work Centre and Network tables.

 

 

This is my Costs data. The grey columns doesn't exist, I have added it to assist with this explanation only.

 

Thank you for any suggestions.

 

Yoshi

  • Hi Yoshimitsu411 ,

     

    You can create a slicer table first.

    Slicer Table = DISTINCT(UNION(DISTINCT(Network[Work Group]),DISTINCT('Work Centre'[Work Group])))

    Get the corresponding work group in the cost table.

    g_network = RELATED(Network[Work Group])
    g_work_centre = RELATED('Work Centre'[Work Group])

    Use the switch or if statement to create a measure.

    Measure = SWITCH(TRUE(),
    MAX(Cost[g_network]) in VALUES('Slicer Table'[Work Group]),1,
    MAX(Cost[g_work_centre]) in VALUES('Slicer Table'[Work Group]),1,0)

    Drag this measure into the visual level filter.

    Sample .pbix

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support

    Hi Yoshimitsu411 ,

     

    You can create a slicer table first.

    Slicer Table = DISTINCT(UNION(DISTINCT(Network[Work Group]),DISTINCT('Work Centre'[Work Group])))

    Get the corresponding work group in the cost table.

    g_network = RELATED(Network[Work Group])
    g_work_centre = RELATED('Work Centre'[Work Group])

    Use the switch or if statement to create a measure.

    Measure = SWITCH(TRUE(),
    MAX(Cost[g_network]) in VALUES('Slicer Table'[Work Group]),1,
    MAX(Cost[g_work_centre]) in VALUES('Slicer Table'[Work Group]),1,0)

    Drag this measure into the visual level filter.

    Sample .pbix

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.