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
amikm
Helper V
Helper V

Matrix visual is not summing up

I have a matrix visual. I have one measure which is showing 1 or blank as per business logic. I want to show the roll-up of those values in the hierarchy.
I wrote the below DAX to achieve the same but It's not giving the correct value. Ideally, the value should be 8
Measure = IF(HASONEFILTER('CAM Alignment'[FullName_L1]) &&

HASONEFILTER('CAM Alignment'[FullName_L2])&&
HASONEFILTER(Validation_Accounts_Agreements[CalculatedAccountNameNumber]),
if([MeasureCappedCountSolution]=1,1,blank()),
CALCULATE(COUNTROWS(DISTINCT(Validation_Accounts_Agreements[CalculatedAccountNameNumber])),FILTER(SFDC_Opportunity_NBV,[MeasureCappedCountSolution]=1)))
 
DAXIssue.png
6 REPLIES 6
v-rzhou-msft
Community Support
Community Support

Hi @amikm 

I build an easy sample to have a test and I use ISINSCOPE function to achieve your goal.

1.png

And I build two measures at first.

MeasureSale = SUM('Table'[Sales])
MeasureCappedCountSolution = IF(NOT([MeasureSale] in {2,4}),1,BLANK())

Then I build a new measure and the result is as below.

Measure = IF(ISINSCOPE('Table'[LEVEL3]),[MeasureCappedCountSolution],SUMX(ALL('Table'),[MeasureCappedCountSolution]))

Result is as below. The measure works well.

2.png

You can download the pbix file from this link: Matrix visual is not summing up

 

Best Regards,

Rico Zhou

 

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

Anonymous
Not applicable

Hi as per our requirement the AVP,RVP are coming from differnt table (let say hierarchy), the measurecount is coming from validation table. Now as per your formula could you please help what table we need to take in ALL function.

Hi @Anonymous 

Could you provide me with your table samples? This may make it easier for me to understand your data model.

 

Best Regards,

Rico Zhou

 

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

tex628
Community Champion
Community Champion

The integrated totals is not actually summarizing the rows above but instead calculating the same measure without any of the rowcontext in your matrix.

Try this and replace the referece to "YourDimension" to the lowest row dimension that you are using in your matrix:

Measure 2 =
SUMX(
SUMMARIZE(
'Table'[YourDimension] , 
"Value" , [MeasureCappedCountSolution]
) , [Value]
)


Br,
J

 


Connect on LinkedIn

Hi @tex628
I created the measure (Measure_test), what you have described,
but I am not getting a roll up the sum, I am expecting 8 as a sum when we do rollup in the hierarchy.
DAX2.png

tex628
Community Champion
Community Champion

Can you provide the code for the MeasureCappedCountSolution measure? 


Connect on LinkedIn

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.