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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ChoiJunghoon
Helper III
Helper III

DAX -Create New table

HI

I can't think how to create new table by using DAX formula. 

TableA

CategoryCharge
A3
B4
C2
D1

 

TableB

Index
1
2
3
4
5
6
7
8
9
10

 

I wanto to create the NewTable 

Result

IndexCategory
1A
2A
3A
4B
5B
6B
7B
8C
9C
10D

 

Could you help me ? 

 

2 ACCEPTED SOLUTIONS
wdx223_Daniel
Super User
Super User

Jihwan_Kim
Super User
Super User

Hi, @ChoiJunghoon 

Please check the below picture and the sample pbix file's link down below.

 

Picture2.png

 

Result Table =
VAR rankAaddcolumn =
ADDCOLUMNS ( TableA, "@rankcategory", RANKX ( TableA, TableA[Category],, ASC ) )
VAR cumulateaddcolumn =
ADDCOLUMNS (
rankAaddcolumn,
"@cumulatemax",
SUMX (
FILTER ( rankAaddcolumn, [@rankcategory] <= EARLIER ( [@rankcategory] ) ),
TableA[Charge]
)
)
VAR cumulateaddcolumnstep2 =
ADDCOLUMNS (
cumulateaddcolumn,
"@cumulatemin",
SUMX (
FILTER ( cumulateaddcolumn, [@rankcategory] = EARLIER ( [@rankcategory] ) - 1 ),
[@cumulatemax]
)
)
VAR addtoindexcolumn =
ADDCOLUMNS (
TableB,
"Category",
SUMMARIZE (
FILTER (
cumulateaddcolumnstep2,
[@cumulatemin] < TableB[Index]
&& [@cumulatemax] >= TableB[Index]
),
TableA[Category]
)
)
RETURN
addtoindexcolumn

 

 

https://www.dropbox.com/s/voz6y9o9e04cht3/choijunghoon.pbix?dl=0 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @ChoiJunghoon 

Please check the below picture and the sample pbix file's link down below.

 

Picture2.png

 

Result Table =
VAR rankAaddcolumn =
ADDCOLUMNS ( TableA, "@rankcategory", RANKX ( TableA, TableA[Category],, ASC ) )
VAR cumulateaddcolumn =
ADDCOLUMNS (
rankAaddcolumn,
"@cumulatemax",
SUMX (
FILTER ( rankAaddcolumn, [@rankcategory] <= EARLIER ( [@rankcategory] ) ),
TableA[Charge]
)
)
VAR cumulateaddcolumnstep2 =
ADDCOLUMNS (
cumulateaddcolumn,
"@cumulatemin",
SUMX (
FILTER ( cumulateaddcolumn, [@rankcategory] = EARLIER ( [@rankcategory] ) - 1 ),
[@cumulatemax]
)
)
VAR addtoindexcolumn =
ADDCOLUMNS (
TableB,
"Category",
SUMMARIZE (
FILTER (
cumulateaddcolumnstep2,
[@cumulatemin] < TableB[Index]
&& [@cumulatemax] >= TableB[Index]
),
TableA[Category]
)
)
RETURN
addtoindexcolumn

 

 

https://www.dropbox.com/s/voz6y9o9e04cht3/choijunghoon.pbix?dl=0 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1624494945460.pngwdx223_Daniel_1-1624494960023.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.