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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Justas4478
Responsive Resident
Responsive Resident

Sum string values for total in rows

Hi, I have this measure that counts my [document number].

CALCULATE(
    DISTINCTCOUNT('Outbound Delivery Document'[DocumentNumber]),
    REMOVEFILTERS('Date'[Date]),
    TREATAS(VALUES('Outbound Delivery'[OutboundDeliveryDocumentKey]), 'Outbound Delivery Document'[OutboundDeliveryDocumentKey])
)
Justas4478_0-1721035445031.png

I am trying to sum the result so it would show total 660 in all rows.
But which ever solution I tried it just brings back same results as in the image.
I can't do nurmal sum since [document number] is in a text format and sum does not work with strings.
9 REPLIES 9
v-kaiyue-msft
Community Support
Community Support

Hi @Justas4478 ,

 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

 

Best Regards,

Clara Gong

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

v-kaiyue-msft
Community Support
Community Support

Hi @Justas4478 ,

 

Thanks for the reply from @bhanu_gautam  and @Arul , please allow me to provide another insight:

 

CALCULATE (
    DISTINCTCOUNT ( 'Outbound Delivery Document'[DocumentNumber] ),
    REMOVEFILTERS ( 'Date'[Date] ),
    REMOVEFILTERS ( 'Outbound Delivery Document'[SKU Number] ),
    TREATAS (
        VALUES ( 'Outbound Delivery'[OutboundDeliveryDocumentKey] ),
        'Outbound Delivery Document'[OutboundDeliveryDocumentKey]
    )
)

 

Please try the expression above.


If it does not solve your problem, can you create some representative data and explain the relationship between the tables so that we can better help you solve the problem.

 

 

Best Regards,

Clara Gong

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

@v-kaiyue-msft Unfortunatelly it did not work so i will try to explain relationship the best I can.
Starting from Outbound delivery document table. It has only one relationship:

Justas4478_0-1721806194316.png

As you cans see document tabel does not have any direct realtionship with date or product table that holds sku numbers.

Second is Outbound Delivery table that has 4 relationships:

Justas4478_1-1721806461875.png

They have connection to the date table via DateKey

Justas4478_2-1721806559398.png

They have connection to Product table that holds SKU information.

Justas4478_3-1721806629778.png

3rd relationship is to Outbound delivery customer table that holds customer names
The Outbound delivery customer table does not have any other relationships.
Let me know if it helps and if you need I can provide data sample.
Thanks

bhanu_gautam
Super User
Super User

@Justas4478 , Try using measure

 


TotalDistinctDocumentCount =
CALCULATE(
[DistinctDocumentCount],
ALL('Outbound Delivery Document')
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam I tried it but still got same results.

Justas4478_0-1721042457242.png

 

Can you share PBIX file




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam I can't share the pbi file since I am on live connection model.

Arul
Super User
Super User

@Justas4478 ,

Please provide few rows of sample data.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Justas4478
Responsive Resident
Responsive Resident

@Arul Here is the sample file if that helps.
https://we.tl/t-uPPaZK5iZy

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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