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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Hong_HW
Frequent Visitor

To get a combined value in the table by applying different filter value

Dear All,

 

I would like to seek some help regarding the BI filters and tables.

I want to build a table with the combined value from both Product AAA & Prodcut BBB by applying the different filter value.

 

I have uploaded the PBI file here https://drive.google.com/file/d/15jO-jFcpn_NIW03ixCnthKkYoj1YpvBY/view?usp=sharing

 

Hong_HW_1-1654346492050.png

Hong_HW_0-1654346670393.png

 

 

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

Hi @Hong_HW ,

I updated your sample pbix file(see attachment), please check whether that is what you want.

1. Create a calculated table as below copied with the table 'Time_Required':

 

Time_Required2 = 'Time_Required'

 

yingyinr_0-1654570585681.png

2. Create a slicer with the field [Time Required] in new table 'Time_Required' to replace the slicer "Filter for Product BBB"

yingyinr_0-1654587237649.png

3. Remove the relationship between Time_Required and Test_Data

yingyinr_1-1654587318853.png

4. Create two measures as below and place them on the top two matrix Values field instead of the original Values field

AAA =
CALCULATE (
    SUM ( 'Test_Data'[Value] ),
    FILTER (
        'Test_Data',
        'Test_Data'[Time Required] = SELECTEDVALUE ( 'Time_Required'[Time Required] )
    )
)
BBB = 
CALCULATE (
    SUM ( 'Test_Data'[Value] ),
    FILTER (
        'Test_Data',
        'Test_Data'[Time Required] = SELECTEDVALUE ( 'Time_Required2'[Time Required] )
    )
)

yingyinr_2-1654587840464.png

5. Create a measure as below to get the sum value of product AAA and BBB

 

Measure = 
SUMX ( FILTER ( 'Test_Data', 'Test_Data'[Product Name] = "AAA" ), [AAA] )
    + SUMX ( FILTER ( 'Test_Data', 'Test_Data'[Product Name] = "BBB" ), [BBB] )

 

yingyinr_3-1654587891310.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @Hong_HW ,

I updated your sample pbix file(see attachment), please check whether that is what you want.

1. Create a calculated table as below copied with the table 'Time_Required':

 

Time_Required2 = 'Time_Required'

 

yingyinr_0-1654570585681.png

2. Create a slicer with the field [Time Required] in new table 'Time_Required' to replace the slicer "Filter for Product BBB"

yingyinr_0-1654587237649.png

3. Remove the relationship between Time_Required and Test_Data

yingyinr_1-1654587318853.png

4. Create two measures as below and place them on the top two matrix Values field instead of the original Values field

AAA =
CALCULATE (
    SUM ( 'Test_Data'[Value] ),
    FILTER (
        'Test_Data',
        'Test_Data'[Time Required] = SELECTEDVALUE ( 'Time_Required'[Time Required] )
    )
)
BBB = 
CALCULATE (
    SUM ( 'Test_Data'[Value] ),
    FILTER (
        'Test_Data',
        'Test_Data'[Time Required] = SELECTEDVALUE ( 'Time_Required2'[Time Required] )
    )
)

yingyinr_2-1654587840464.png

5. Create a measure as below to get the sum value of product AAA and BBB

 

Measure = 
SUMX ( FILTER ( 'Test_Data', 'Test_Data'[Product Name] = "AAA" ), [AAA] )
    + SUMX ( FILTER ( 'Test_Data', 'Test_Data'[Product Name] = "BBB" ), [BBB] )

 

yingyinr_3-1654587891310.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much, it works 🙂

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors