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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Chriswyy
Frequent Visitor

New to Power BI (DAX)

Hi guys, just started to learn power bi.

Would like to understand why error happens when I input the following formula:

 

=SUM(DISTINCT('Jun23 Data'[INCOME_AMT]))

 

Error returned: The SUM function only accepts a column reference as an argument.

 

Assuming below is my dataset

Month : Income_amt

Jan : 100

Feb : 100

March : 200

 

 

ps: I know this formula doesn't make sense... to sum distinct values for monthly income. But i just wanna find out how the dax works and why i cant get 300 in total.

1 ACCEPTED SOLUTION

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, 

If I am not wrong, DISTINCT DAX function returns a table.

However, SUM DAX function needs a column.
Please try something like below.

 

Jihwan_Kim_0-1690341434410.png

 

Or,

 

Jihwan_Kim_1-1690341529177.png

 

 

 

Expected result measure: = 
VAR _t =
    SUMMARIZE ( Data, Data[Income_amt] )
RETURN
    SUMX ( _t, Data[Income_amt] )

 

Expected result measure V2: = 
VAR _t =
    DISTINCT(Data[Income_amt])
RETURN
    SUMX ( _t, Data[Income_amt] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

IMG_3862.png

 hmm.. I thought it will return a column based on the documentation 

Hi @Chriswyy 

 

It returns a table with an unique column...That's why you need to use Sumx.
Check this at: https://dax.guide/distinct/#:~:text=DISTINCT%20DAX%20Function%20(Table%20manipulation)&text=Returns%....

Or the official link: https://learn.microsoft.com/en-us/dax/distinct-function-dax

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.