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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

Top Kudoed Authors