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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nandy
New Member

Table (Row level calculation)

Hi Team  I have 6 columns ex:column 1,column 2 ,column 3,column 4 ,column 5 ,column 6..I want to add in power bi table visual  I want filter  visual should contain column names as filter 1:Column 1 and column 2 as values to select  and filter 2 should have column 3 and column 4 as value to select and table visual out put should be as below  Column 1+column 2 column 6 column 3 +column 4 column 7 Data is getting divided beacuse as per power bi it wont accept row level calculation ..Can you please guide anyone it could be great help Thanks Nandish

3 REPLIES 3
Icey
Community Support
Community Support

Hi @nandy ,

 

Please check if my undersatnding is correct.

 

I think you are having trouble in the following example.

 

Sample data is as follows.

sample.png

 

You want to calculate the sum of the values of A and B. Then you split 2019 and 2020 to get the following table. At last you get the sum of 2019 and 2020 as follows.

sample2.png

SUM = MAX('Table (3)'[2019])+MAX('Table (3)'[2020])

 sample3.png

 

Actually, you dont need to do this. You can use ALLEXCEPT function to calculate in the first table. You can write your measure like so.

Measure =
CALCULATE (
    SUM ( 'Table'[Value] ),
    ALLEXCEPT ( 'Table', 'Table'[User] )
)

sample4.png

 

If you still need the filter with column names. You can create a new table as below.

filter.png

Then you can write a measure.

Value/Year = 
VAR tt =
    SELECTEDVALUE ( 'Table (2)'[Column1] )
RETURN
    SWITCH ( tt, "Value",MAX('Table'[Value]), "Year",MAX('Table'[Year]
))

filter3.pngfilter2.png

You can check more details from here.

 

 

Best Regards,

Icey

 

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

Pragati11
Super User
Super User

HI @nandy ,

 

Please add detail to your question. This is not making any sense to me.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

camargos88
Community Champion
Community Champion

@nandy ,

 

Can you give some example with dummy data ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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