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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
WaXpEd
Frequent Visitor

DAX Column & SUMIFS with Earlier Quarter

Hi all,

 

I'm trying since 4 hours from now to achieve this formula. Without any success...

 

I'm trying with earlier function to retrieve the total amount into a quarter from a previous quarter in the column.

 

IndexQuarterProjectCombo ProjectIndex ComboValueValue Earlier
1Q215666666Q2156666661100
2Q215666666Q2156666661200
3Q215666666Q2156666661300
4Q315666666Q21566666644060
5Q315666666Q2156666664500
6Q315666666Q2156666664600

 

In Excel I woul have perform SUMIFS on "Value Earlier" column with the argument "Q2", but this is not possible in PowerBI as row is referenced under "Q3".

 

I can't plug a specfic number under the earlier function to take the previous "Index Combo" Value, as I can have multiple values in each quarter for each projects.

 

Thanks in advance, I think I've explored all combination of earlier over there.

 

WaX.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try new columns like


Quarter No = right([Quarter],1)

Value Earlier = sumx(filter(table,table[Project]=earlier(table[Project]) && [Quarter No] =earlier([Quarter No])-1),[Value])

 

But if want index 4 only to have this new value , then additional logic need to be added to find min of the qtr

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Perhaps:

 

Value Earlier Column = 
  VAR __Quarter = [Quarter]
  VAR __PreviousQuarter = 
    SWITCH(__Quarter,
      "Q1","Q4",
      "Q2","Q1",
      "Q3","Q2",
      "Q1"
    )
RETURN
  SUMX(FILTER('Table',[Quarter] = __PreviousQuarter),[Value])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Pragati11
Super User
Super User

Hi @WaXpEd ,

 

Are you looking for the follwoing solution as shown below:

q1.png

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

Try new columns like


Quarter No = right([Quarter],1)

Value Earlier = sumx(filter(table,table[Project]=earlier(table[Project]) && [Quarter No] =earlier([Quarter No])-1),[Value])

 

But if want index 4 only to have this new value , then additional logic need to be added to find min of the qtr

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks a lot @amitchandak very helpful, it works now. Obvious with only numbers now you've spotted this! 

 

Thanks again.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors