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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Tracy000
Helper I
Helper I

How to generate a new table base on some conditions

Hi team,

 

Good day, I got a problem which need your kind advice, thanks in advance.

I have a table1 in Power BI, the data is as following:

Tracy000_1-1710400610984.png
Now I want to create another table (table2) base on table1, but only select few data base on conditions 1 & 2:
1. Only select these 4 columns data: GEOGRAPHY.03 MARKET, FISCAL TIME.04 FISCAL MONTH, PRODUCT LINE, AMT
2. Only the sum of AMT for GEOGRAPHY.02 SUPER REGION is not 0 should show in this table2
so this means only row 9-13 meet this condition, because row 1-8 sum AMT for SUPER REGION Asia Pacific is 0, although row 13 contains 0, but sum of AMT for Americas is not 0.

So finally I would like to generate the table 2 like following:

Tracy000_2-1710400668122.png

 

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

bhi, @Tracy000 

 

try below code for new table it might work

newtable=
calculatetable(
 summarize(
    table1[geography.03market],
    table1[fiscaltime.04fiscalmonth],
    table1[productline],
    table1[amt]
 ),
 filter(
    values(table1[GEOGRAPHY.02 SUPER REGION]),
    sum(table1[amt])>0
 )
)

 

 

 

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

3 REPLIES 3
Dangar332
Super User
Super User

bhi, @Tracy000 

 

try below code for new table it might work

newtable=
calculatetable(
 summarize(
    table1[geography.03market],
    table1[fiscaltime.04fiscalmonth],
    table1[productline],
    table1[amt]
 ),
 filter(
    values(table1[GEOGRAPHY.02 SUPER REGION]),
    sum(table1[amt])>0
 )
)

 

 

 

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

@Dangar332 
Seems I got the result I want.

Added a variable to keep the filters and then applied to table2 as you suggested above.
var table1 = SUMMARIZECOLUMNS([GEOGRAPHY.02 SUPER REGION], [PRODUCT LINE], "SUMAMT", sum([amt]))

Thank you!

@Dangar332 
Thanks a lot for your quick reply!

I'm really sorry that I missed one very important point in condition2 in the original post:
2. Only the sum of AMT for GEOGRAPHY.02 SUPER REGION and PRODUCT LINE is not 0 should show in this table2.

(The AMT should be based on both GEOGRAPHY.02 SUPER REGION and PRODUCT LINE level)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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