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
andrew260z
Frequent Visitor

Show non summarised cost

Hi all, been trying to create either a group by or a distinct sum to represent savings for some data

 

Example of the data below - the sum of the final cost is 21,000 but i need to also show the 7,000  (as the consolidatedob coumn would be distinct) and the actual amount paid was 7,000;

 

Screenshot_10.png
 

I've tried a few different ways to do this but it keeps showing me the summarised sum 

FinalCostSum = SUMX(Distinct('TrackingList Archive'[ConsolidatedOB]),SUM('TrackingList Archive'[Final_Cost]))
 
Should I be doing this with a group by perhaps and linking back to the value CsondolidatedOB?
1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @andrew260z ,

I created the data:

v-yangliu-msft_0-1622451353630.png

Here are the steps you can follow:

1. Create measure.

HASONEVALUE =
IF(HASONEVALUE('Table'[date]),MAX('Table'[Final_Cost]),MAX('Table'[Final_Cost]))

2. Result:

v-yangliu-msft_1-1622451353639.png

 

Best Regards,

Liu Yang

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

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @andrew260z ,

I created the data:

v-yangliu-msft_0-1622451353630.png

Here are the steps you can follow:

1. Create measure.

HASONEVALUE =
IF(HASONEVALUE('Table'[date]),MAX('Table'[Final_Cost]),MAX('Table'[Final_Cost]))

2. Result:

v-yangliu-msft_1-1622451353639.png

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@andrew260z , calculate is must in sumx function in case you are not using a measure

 

FinalCostSum = SUMX(values('TrackingList Archive'[ConsolidatedOB]),calculate(SUM('TrackingList Archive'[Final_Cost])))

Thanks for the suggestion but even with the VALUES instead it returns the sum of all 3 final_cost values (21,000) instead of the 7,000 (value of the final_cost in distinct)

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.