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
Juju123
Helper III
Helper III

Sumx not return good total

Hi, 

I have a problem with SUMX fonction. I have a table in which i want to sum calculated column. 

I create a DAX formula for calculated column : 

TEST = IF([Measure]<>0,1,0)

Then i want to have the sum of this calculated column but it's not work. Power BI return blank value in sum and i don't understand :

Sum Test = SUMX(CAGC_MFG_ECART_PDC_PPPI_REP,[TEST])

Juju123_0-1699401863183.png

 

Can you explain me why i have not "Total" for column "Test" and why column "Sum test" return blank value while there are value in column "Test" ? 

 

Thanks

 

1 ACCEPTED SOLUTION

Thanks you so much ! it's works

View solution in original post

17 REPLIES 17
Ashish_Mathur
Super User
Super User

I think you are confusing between measures and calculated columns.  Share some data, explain the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

In fact I want to display the reference number according to the selection made by the user.

User has several filters.
Depending on the filters that it will select, I must display the reference number which is displayed in a card.

Currently I have this table but the final result I have in the table does not match and the result I have in my map does not match also.

 

For example, to test that my measurement works, I selected the year 2023 in my data.
My table shows me 94 lines but my measure calculate 195 references. I think my measure

Juju123_3-1699420739612.png

 

I create this Dax formula (it's measure column) : 

Juju123_1-1699419517956.png

 

Nb Ref. = DISTINCTCOUNT(TABLE[Ref.])

 

This Dax column depend on this calculated column

Juju123_2-1699419608673.png

 

Ref. = REF&"-"LIGNES_NUMBER

 

Sorry but i can't attach pbix file in my comment. When i want to share pbix, i have this error The file type (.pbix) is not supported.

 

Upload the file to One Drive and share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

i don't know if you know smash. I put the pbix in this plateform

you can dowload it with this link : 

https://fromsmash.com/Distinct-value-selected-pbi 

I am not comfortable with using that platform.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur ,

I create download link with One Drive : 

test_distinct_value.pbix

 

Can you tell me it's ok for you ?

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1699433117551.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks @Ashish_Mathur 

i see the pbi and your test and I will back

 

On the other hand I would like to know why you have 2 for the month of June 2023 and not 1?

 

Test the result and study the solution thoroughly.  If there are problems, then clearly show the problem and also the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I see pbix and the result it's not good. 

The result i want it's : 

Juju123_0-1699439338600.png

The problem is that the measurement counts the number of dates that the reference to per month.

For example for the month of October we have the number 5 because the reference to 5 different dates in October.
Whereas what I would like is if the reference appears 5 times in the month of October then I count the reference only 1 time

 

PBI file attached

Ashish_Mathur_0-1699440497344.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks you so much ! it's works

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur,

J'ai appliqué la formule dax sur un plus gros échantillon de données et le rapport est très très lent.

Est-il possible de remplacer la fonction résumé par une autre ou d'utiliser une façon de faire en DAX ?

I find a solution

 

I create a concatenate column in database and after i use only this dax formula

NEW_NUMBER_REF = COUNTROW('TABLE'[KEY_CARD])
Kishore_KVN
Super User
Super User

Hello @Juju123 ,

 

Please check the data type of your measure and if it is general or text change it to whole number that may help you in acheiving your requirement.

 

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

Hi @Kishore_KVN

My column it's measure and i have a good forma : 

Juju123_5-1699421809095.png

Juju123_6-1699421828296.png

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors