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
o59393
Post Prodigy
Post Prodigy

Column Total is not returning the desired value

Hi all

 

I need to have in my dax the total from a column, however the way I have my formula it not working properly.

 

Basically I want to have the sum of the column called "Ingredient dax above parameter" seen below:

 

parameter value.png

 

As seen, the value returned is 29,916 but I would like to have the sum of those values which would give me: 6,143

 

The dax for that column is:

 

 

Ingredient dax above parameter = 
IF([Value]>Parameter[Parameter Value]
,
(Parameter[Parameter Value]*SUM(Query1[[Totals]]])*5.678*0.01)/1000
,
BLANK())

 

For the parameter I am using 7.4 as an example

 

In the excel attached I explain were the value of 29,915 from that column comes from. As well as the result I would like toi have, which is in cell G63, pretty much is the sum of the individual values.

 

Please let me know if this is clear, I have some difficulties uploading a pbix due to sensible data.

 

Excel: https://1drv.ms/x/s!ApgeWwGTKtFdhlo5bN320A3Y4Y7f?e=JJwkjM

 

Thank you.

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this:

Ingredient dax above parameter =
SUMX (
    GROUPBY ( Query1, Query1[Value] ),
    CALCULATE (
        IF (
            MAX ( Query1[Value] ) > Parameter[Parameter Value],
            (
                Parameter[Parameter Value] * SUM ( Query1[Total] ) * 5.678 * 0.01
            ) / 1000,
            BLANK ()
        )
    )
)

The result shows:

50.PNG

Here is the test pbix file:

pbix 

Hope this helps.

If my answer has solved your issue, please mark it as a solution for others to see.
Thanks!

 

Best Regards,

Giotto

View solution in original post

2 REPLIES 2
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this:

Ingredient dax above parameter =
SUMX (
    GROUPBY ( Query1, Query1[Value] ),
    CALCULATE (
        IF (
            MAX ( Query1[Value] ) > Parameter[Parameter Value],
            (
                Parameter[Parameter Value] * SUM ( Query1[Total] ) * 5.678 * 0.01
            ) / 1000,
            BLANK ()
        )
    )
)

The result shows:

50.PNG

Here is the test pbix file:

pbix 

Hope this helps.

If my answer has solved your issue, please mark it as a solution for others to see.
Thanks!

 

Best Regards,

Giotto

amitchandak
Super User
Super User

Try like

sux(Summarize(Table,table[country],table[Product],"_1",[Ingredient dax above parameter]),[_1])

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.