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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
SH-4
Frequent Visitor

Sum the month, when only one day is selected

So I have this formula in Excel, which looks at the month number I have above my date to sum up an entire row that matches that month number in order to determine which rate I want to multiply that day's units by, since they base the rates off the monthly sum.

SH4_0-1682603740617.png=IF(SUMIF('X'!4:4, 4, 'X'!27:27)>=365000, (CS31*0.077),

IF(SUMIF('X'!4:4, 4, 'X'!27:27)>=243000, (CS31*0.095),

IF(SUMIF('X'!4:4, 4, 'X'!27:27)>=162000, (CS31*0.117),

IF(SUMIF('X'!4:4, 4, 'X'!27:27)>=121000, (CS31*0.15),

IF(SUMIF('X'!4:4, 4, 'X'!27:27)>=80000, (CS31*0.2),

IF(SUMIF('X'!4:4, 4, 'X'!27:27)>=1, (CS31*0.5),

0))))))

I'm trying to get this to work in DAX, when only one day is selected, but I can't get it to look at the whole month's numbers to sum when only one day is selected. Does anyone have any experience with trying to get this to work?

1 ACCEPTED SOLUTION
SH-4
Frequent Visitor

okay actually... I figured it out! if anyone needs it, I used a combination of TOTALMTD() and DATEMTD()

Units MTD = TOTALMTD((CALCULATE(SUM('X'[QTY]), 'X'[CLIENT_ID]="Client", 'X'[ORDTYP (groups)]="Normal")), DATESMTD('calendar'[Date]))

unit shipped revenue =
    IF([Units MTD]>=365000, ([Outbound Units X]*[unit 365k rate]),
    IF([Units MTD]>=243000, ([Outbound Units X]*[unit 243k rate]),
    IF([Units MTD]>=162000, ([Outbound Units X]*[unit 162k rate]),
    IF([Units MTD]>=121000, ([Outbound Units X]*[unit 121k rate]),
    IF([Units MTD]>=80000, ([Outbound Units X]*[unit 80k rate]),
    IF([Units MTD]>=1, ([Outbound Units X]*[unit 1 rate]),
    0))))))

View solution in original post

2 REPLIES 2
SH-4
Frequent Visitor

okay actually... I figured it out! if anyone needs it, I used a combination of TOTALMTD() and DATEMTD()

Units MTD = TOTALMTD((CALCULATE(SUM('X'[QTY]), 'X'[CLIENT_ID]="Client", 'X'[ORDTYP (groups)]="Normal")), DATESMTD('calendar'[Date]))

unit shipped revenue =
    IF([Units MTD]>=365000, ([Outbound Units X]*[unit 365k rate]),
    IF([Units MTD]>=243000, ([Outbound Units X]*[unit 243k rate]),
    IF([Units MTD]>=162000, ([Outbound Units X]*[unit 162k rate]),
    IF([Units MTD]>=121000, ([Outbound Units X]*[unit 121k rate]),
    IF([Units MTD]>=80000, ([Outbound Units X]*[unit 80k rate]),
    IF([Units MTD]>=1, ([Outbound Units X]*[unit 1 rate]),
    0))))))
Anonymous
Not applicable

Hi @SH-4 ,

 

I'm so glad you have solved your issue. And thanks for sharing this method for us to solve this issue. 

Please mark your reply as a solution. More people will benefit from it. 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.