cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

incorrect Column Total

 

MatrixMatrix

 

The column total is incorrect in Matrix Visual. The month measure has 9 weeks. The weeks after w5 are filtered at visual level. The current total is calculated for all 9 weeks. I want to get the total for only 5 weeks in this visual. can you please help me to fix this?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Frequent Visitor

Re: incorrect Column Total

I am getting memory issue if use sumx function. "There is not enough memory to complete the operation.

View solution in original post

Highlighted
Community Support
Community Support

Re: incorrect Column Total

Hi, @Aruljoy 

 

Based on your description, I create data to reproduce your scenario. The pbix file is attached in the end.

Table:

e1.png

 

You may create two calculated columns and a measure as below.

Calculated column:
Month = FORMAT('Table'[Date],"mmm")
Weeknum = "W"&WEEKNUM('Table'[Date])

Measure:
Result = 
IF(
    ISINSCOPE('Table'[Weeknum]),
    SUM('Table'[Value]),
    CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Month] = SELECTEDVALUE('Table'[Month])))
)

 

Result:

e2.png

e3.png

 

Best Regards

Allan

 

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

6 REPLIES 6
Highlighted
Super User VI
Super User VI

Re: incorrect Column Total

Hi @Aruljoy 

you need to create a measure like

Measure = SUM(Table[Value])

and put it into visual as value


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Highlighted
Frequent Visitor

Re: incorrect Column Total

Thanks for the response @az38 . But the value is already a measure. 

Num_Closure =
Var _selected = SELECTEDVALUE('Cut Points1'[Measures])
Var _Result =[Num_by_Week] - [Num_by_PrevWeek]
Return
IF(_selected in {"OMW","CTM","AnG"},"NA",_Result)
Can you please let me know how to handle this?
Highlighted
Super User VI
Super User VI

Re: incorrect Column Total

@Aruljoy 

how do look like your [Num_by_Week] and [Num_by_PrevWeek] measures?

also try

Var _Result = CALCULATE(SUMX(Table, [Num_by_Week] - [Num_by_PrevWeek]))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Highlighted
Frequent Visitor

Re: incorrect Column Total

I am getting memory issue if use sumx function. "There is not enough memory to complete the operation.

View solution in original post

Highlighted
Community Support
Community Support

Re: incorrect Column Total

Hi, @Aruljoy 

 

Based on your description, I create data to reproduce your scenario. The pbix file is attached in the end.

Table:

e1.png

 

You may create two calculated columns and a measure as below.

Calculated column:
Month = FORMAT('Table'[Date],"mmm")
Weeknum = "W"&WEEKNUM('Table'[Date])

Measure:
Result = 
IF(
    ISINSCOPE('Table'[Weeknum]),
    SUM('Table'[Value]),
    CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Month] = SELECTEDVALUE('Table'[Month])))
)

 

Result:

e2.png

e3.png

 

Best Regards

Allan

 

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

Highlighted
Frequent Visitor

Re: incorrect Column Total

Thanks Allan. This work for me.

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors