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
Anonymous
Not applicable

Matrix total not showing

Hi,

 

I have below DAX, it does not show the total, I would like to show the total regardless of the visual, I will be using this measure in calculation of other measures:

 

Budget2 Volume Target =
VAR CapVic = CALCULATE
(CALCULATE(
SUM('KPI Target'[Value]),
FILTER( 'KPI Target','KPI Target'[Target Code] ="BUDGET VOL"
&& 'KPI Target'[Dimension 2 Value] = ">CAP"),
ALLEXCEPT('Posting Date', 'Posting Date'[Date])
), CROSSFILTER('KPI Target'[LocationLookupKey], Location[LocationLookupKey], None)
)
VAR BugdetVolAll = CALCULATE(
SUM('KPI Target'[Value]),
FILTER( 'KPI Target','KPI Target'[Target Code] ="BUDGET VOL"
&& 'KPI Target'[Open] =1))
Return

IF(HASONEVALUE(Location[County]),
IF(VALUES(Location[County]) = "VIC",
CapVic + BugdetVolAll,
BugdetVolAll
)
)
 
Not sure why, can someone help?
Thanks.
3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , because you have used hasonevalue and grand total does not have one

 

you can try a new measure like. or add this return value

Sumx(Values(Location[County]) , [Budget2 Volume Target])

Anonymous
Not applicable

Thanks, it worked.

I tired to do it all in one measure, but did not work, like below:

Budget Volume Target =
VAR CapVic = CALCULATE
(CALCULATE(
SUM('KPI Target'[Value]),
FILTER( 'KPI Target','KPI Target'[Target Code] ="BUDGET VOL"
&& 'KPI Target'[Dimension 2 Value] = ">CAP"),
ALLEXCEPT('Posting Date', 'Posting Date'[Date])
),
CROSSFILTER('KPI Target'[LocationLookupKey], Location[LocationLookupKey], None)
)
VAR BugdetVolAll = CALCULATE(
SUM('KPI Target'[Value]),
FILTER( 'KPI Target','KPI Target'[Target Code] ="BUDGET VOL"
&& 'KPI Target'[Open] =1))
VAR AllTarget=

IF(HASONEVALUE(Location[County]),
IF(VALUES(Location[County]) = "VIC",
CapVic + CALCULATE(BugdetVolAll, FILTER( 'KPI Target','KPI Target'[Open] =1)),
CALCULATE(BugdetVolAll, FILTER( 'KPI Target','KPI Target'[Open] =1))
)
)
Return
SUMX(VALUES(Location[County]), AllTarget)

 

Do you kno why?

Hi @Anonymous ,

Please view the video in the following link, you may get the answer from there.

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Best regards

Rena

Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.