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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Help with calculated column

Hi, I have this table, I want to grab the Monthly value of ID 1 :

 

 

11.png

 

And put it in a calculated column for every ID (taking into account the Month) like this:

 

22.png

 

How can I achieve this with DAX ?

 

Thanks

 

 

2 ACCEPTED SOLUTIONS
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

what about this solution:

 

25-09-_2020_22-39-10.png

 

X = CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Month]),'Table'[ID] = 1))

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=CALCULATE(SUM(Data[Value]),FILTER(Data,Data[ID]=1&&Data[Month]=EARLIER(Data[Month])))

Hope this helps.


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=CALCULATE(SUM(Data[Value]),FILTER(Data,Data[ID]=1&&Data[Month]=EARLIER(Data[Month])))

Hope this helps.


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

Hi @Anonymous 

what about this solution:

 

25-09-_2020_22-39-10.png

 

X = CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Month]),'Table'[ID] = 1))

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

darentengmfs
Post Prodigy
Post Prodigy

Hi @Anonymous 

 

I know there's a faster way to do this but I do not know how, but this is how I would approach your problem.

 

  1. Create a new column, ID_New = 1, this will make all rows 1
  2. Change ID_New and ID columns data type into text
  3. Create 2 more new columns, ID_New-Month and ID-Month, with the formula ID_New-Month = concatenate(ID_New,Month) and ID-Month = concatenate(ID,Month)
  4. Once you have that, do a lookupvalue column. X = lookupvalue('Table'[Value], 'Table'[ID-Month], 'Table'[ID_New-Month])

 

As mentioned, there has to be a quicker way to do it, but this is how I would do it if I couldn't find the quick way.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors