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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Chari
Frequent Visitor

Sum of multi columns and should display individual columns based on selection.

Hi All.
I summed 4 columns of data using the SUMX function
Chari_0-1713367170174.png

test = CALCULATE(SUMX('Table','Table'[Dad] +'Table'[daddid]+'Table'[did]+'Table'[not]))
Chari_1-1713367297547.png

how to craete dropdwon with four column headers, if i select any one column header from dropdown. the total shpuld upadte with select column.

if i select DAD from dropdown the toatl should be 34
if i select NoT from dropdown the toatl should be 32

Chari_2-1713367632450.png

 



 

 




2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @Chari 

Easiest way is to unpivot the four columns in power query hense the column names would appear as values in the [Attribute] column therefore you can use it as filter. 

View solution in original post

v-zhengdxu-msft
Community Support
Community Support

Hi @Chari 

 

Just as @tamerj1 said that you can unpivote the 4 column, here are detailed step:

First of all, select the four column and unpivote then in power query. 

vzhengdxumsft_0-1713409688285.png

Then add a measure:

Measure 2 = SUM('Table (2)'[Value])

The result is as follow:

vzhengdxumsft_1-1713409995691.pngvzhengdxumsft_4-1713410047098.pngvzhengdxumsft_5-1713410054964.png

 

Best Regards

Zhengdong Xu
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-zhengdxu-msft
Community Support
Community Support

Hi @Chari 

 

Just as @tamerj1 said that you can unpivote the 4 column, here are detailed step:

First of all, select the four column and unpivote then in power query. 

vzhengdxumsft_0-1713409688285.png

Then add a measure:

Measure 2 = SUM('Table (2)'[Value])

The result is as follow:

vzhengdxumsft_1-1713409995691.pngvzhengdxumsft_4-1713410047098.pngvzhengdxumsft_5-1713410054964.png

 

Best Regards

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

tamerj1
Super User
Super User

Hi @Chari 

Easiest way is to unpivot the four columns in power query hense the column names would appear as values in the [Attribute] column therefore you can use it as filter. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.