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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
nemo189
Frequent Visitor

Total Sum in each row in a table issue of DAX

Hello Everyone,
I am facing an issue , and unable to solve.
I have this below data. I want 14968 Value for all the voice numbers under "Total Invoice Amount" similar to "Total test Value" column. I have achieved the Total test Value using a calculated column using Earlier fuction, But its not changing dynamically with slicer selection. With slicer selection the value should be 14968. Here Invoice Item Amount Measure2 is a Measure.
The Total Invoice Amount should be "sum of allthe invoice item amount measure 2 grouped by voice number."

nemo189_1-1709134138859.png

I have written the below formulas:

Invoice Item Amount Measure 2 is a Measure,
Invoice Item Amount Measure 2 =
SUMX(
'Invoice Hold Facts',
IF(
'Invoice Hold Facts'[Highest Ranking Indicator] = "Y",
'Invoice Hold Facts'[Invoice Item Amount],
0
)
)
Total test Value is a Calculated column using Invoice Item Amount Measure 2  
Total test Value =
CALCULATE(
[Invoice Item Amount Measure 2], FILTER('Invoice Hold Facts','Invoice Hold Facts'[Invoice Number] = EARLIER('Invoice Hold Facts'[Invoice Number]) && 'Invoice Hold Facts'[SUPPLIER_WID] = EARLIER('Invoice Hold Facts'[SUPPLIER_WID]) && 'Invoice Hold Facts'[Highest Ranking Indicator] = "Y"))

------------------------------------------------------------------------------------------------------
I have tried other methods as measures , but nothing is working. 
Below are some methods I tried i have commented some methods in it.

Total Amount Measure  =
/*CALCULATE(
SUM('Invoice Hold Facts'[Invoice Item Amount]),
FILTER(
'Invoice Hold Facts',
[Invoice Item Amount Measure] = CALCULATE(
SUM('Invoice Hold Facts'[Invoice Item Amount]),
'Invoice Hold Facts'[Highest Ranking Indicator] = "Y"
)
)
)*/
/*SUMX(
SUMMARIZE(
'Invoice Hold Facts',
'Invoice Hold Facts'[Internal Invoice Id],
"TotalInvoiceAmount", [Invoice Item Amount Measure 2]
),
[TotalInvoiceAmount]
)*/
/*SUMX(
VALUES('Invoice Hold Facts'[Invoice Number]),
[Invoice Item Amount Measure 2]
)*/
/*CALCULATE(
SUM('Invoice Hold Facts'[Invoice Item Amount]),
ALLEXCEPT('Invoice Hold Facts', 'Invoice Hold Facts'[Invoice number])
)*/
SUMX(
VALUES('Invoice Hold Facts'[Invoice Number]),
CALCULATE(
SUM('Invoice Hold Facts'[Invoice Item Amount])
)
)

 



PLEASE HELP. THANKYOU

1 REPLY 1
Anonymous
Not applicable

Hi @nemo189 ,

I read your DAX code carefully, to dynamically calculate the “Total Invoice Amount” based on slicer selections, you can create a measure that considers the filtered context.

I think you can create a Measure for Total Invoice Amount.

Total Invoice Amount = 
CALCULATE(
    [Invoice Item Amount Measure 2],
    FILTER(
        ALLSELECTED('Invoice Hold Facts'),
        'Invoice Hold Facts'[Highest Ranking Indicator] = "Y"
    )
)

The ALLSELECTED function ensures that the slicer selections are considered. The filter condition restricts the calculation to rows where the “Highest Ranking Indicator” is “Y.”

 

 

 

Best Regards

Yilong Zhou

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.