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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ansar
Helper II
Helper II

Customer wise totals are not showing correct

Dears,

 

Need your support to correct the DAX in Image 2 (Measure [PlanLatestDocAmt]) to get customer wise (Cr. Name Column), in that visual Agrmnt column totals are comming properly where as the subtotal showing under each customer is wrong. Ideally the customer wise total is sum of all Agrmnt under that particular customer. 

 

Measure [PlanLatestDocAmt] : - What am trying to achive under this measure is , find the latest transaction of each Agrmnt column and bring the LC Amt column value in to visualizaition by Customer (Cr. Name) & by Agrmnt. 

Latest transaction means , last transaction date & lates document number.

 

Sellout Plan =
CALCULATE(
    SUM(GLData[       LC amnt]),
    GLData[Assignment] = "ZMN1" && GLData[PK] = 40)
 
PlanLatestDocAmt =
VAR MxDt =
    CALCULATE(
        MAX('GLData'[Pstng Date]),
        GLData[Assignment] = "ZMN1" && GLData[PK] = 40
    )

VAR MxDoc =
    CALCULATE(
        MAX('GLData'[Document Number]),
        GLData[Assignment] = "ZMN1" && GLData[PK] = 40
    )

RETURN
    CALCULATE([Sellout Plan],
   
            GLData[Pstng Date] = MxDt &&
            GLData[Document Number] = MxDoc
              
       )

 

ansar_0-1685944576820.png

Image 1 : -

ansar_1-1685944599506.png

 

Image 2 : - 

ansar_3-1685945221796.png

 

 

Regards,

Ansar.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ansar ,

You can create another new measure as below and put it on the matrix to replace the original measure [PlanLatestDocAmt]:

New Measure= SUMX ( VALUES ( 'GLData'[Document Number] ), [PlanLatestDocAmt] )

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
ansar
Helper II
Helper II

Thanks you so much @Anonymous  really appreciated, it works well

Anonymous
Not applicable

Hi @ansar ,

You can create another new measure as below and put it on the matrix to replace the original measure [PlanLatestDocAmt]:

New Measure= SUMX ( VALUES ( 'GLData'[Document Number] ), [PlanLatestDocAmt] )

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.