cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Fahad12
Frequent Visitor

Need help to remove aggregation from my DAX function

So I have a very simple DAX but always get stuck in why it always doesn't accept columns non aggregated columns... I always face this error whether I try to "Add Column" or "New Measure" they both don't allow me to use non aggregated columns as they are. I get this error message: "A single value for column 'X' in table 'Query1' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result." 

 

my intention was to create a loop to calculate the cumulative SUM (Using SUMX) and store it in column Z calculated from column Y at every point in Column X. So the value of column Z at X = column Y at current X value + column Y at all previous X values and this calculation is done at every X point.

This is my DAX should follow this logic (Table name is Query1, columns: X,Y,Z): 

 

VAR __date = Query1[X]
VAR __sum = Query1[Y] at initial Query1[X] value
VAR _loop = GENERATESERIES(min(Query1[X]),max(Query1[X]),1)

VAR __RollingTable = ADDCOLUMNS (_loop, "Y Cumulative sum", __sum + SUMX(FILTER(_loop,Query1[X] <= EARLIER(Query1[X])), Query1[Y] at current X value))

Return
__RollingTable
1 ACCEPTED SOLUTION
NickA01
Resolver II
Resolver II

Not quite shore what you are after here bt i'm reading this as you want to bring a cell value from a previous row? 
Have a look at the Offset function mentioned here. -- it's quite new. 
https://learn.microsoft.com/en-us/dax/new-dax-functions

View solution in original post

3 REPLIES 3
NickA01
Resolver II
Resolver II

Not quite shore what you are after here bt i'm reading this as you want to bring a cell value from a previous row? 
Have a look at the Offset function mentioned here. -- it's quite new. 
https://learn.microsoft.com/en-us/dax/new-dax-functions

tamerj1
Super User
Super User

@Fahad12 
Please provide some screenshots to better explain the problem.

Fahad12
Frequent Visitor

Any help is appreciated.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors