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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Applicable88
Impactful Individual
Impactful Individual

Show Max Value of a column for the current month

Hello,

I want two measures out of this sample table:

 

 

Orders  Date         TargetRevenueMaxWorkDaysRevenueMonth
12344 29.03.2021 150001903.2021
12345 30.03.2021 150001903.2021
12346 31.03.2021 200002004.2021
12347 01.04.2021 200002004.2021
12348 02.04.2021 200002004.2021
12349 03.04.2021 200002004.2021
12350 04.04.2021 200002004.2021

From a calculation and revenue-wise perspective the last workday of a month belongs to the next month. Thats the reason you see that 31.03.2021 has April as monthdate  "04.2021" in its RevenueMonth column. Because of that I cannot use Date for filtering Ihink instead I use RevenueMonth which is formatted as Date column. Also in the table is a column showing the workdays and Targetrevenue for that repspective revenuemonth. 

1.I nead a measure for a KPI -Card which always display the max Workdays of current month. 

 

2.I need a measure for a KPI-Card which always showing me the TargetRevenue of current month. It is different each month.

 

Thank you very much in advance. 

Best. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Applicable88 ,

 

Please try the following formula:

Max Workdays of current month =
VAR _month =
    CALCULATE (
        MAX ( 'Table'[RevenueMonth] ),
        FILTER (
            ALL ( 'Table' ),
            YEAR ( [Date] ) = YEAR ( TODAY () )
                && MONTH ( [Date] ) = MONTH ( TODAY () )
        )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[MaxWorkDays] ),
        FILTER ( 'Table', [RevenueMonth] = _month )
    )

 

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Applicable88 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.😀

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @Applicable88 ,

 

Please try the following formula:

Max Workdays of current month =
VAR _month =
    CALCULATE (
        MAX ( 'Table'[RevenueMonth] ),
        FILTER (
            ALL ( 'Table' ),
            YEAR ( [Date] ) = YEAR ( TODAY () )
                && MONTH ( [Date] ) = MONTH ( TODAY () )
        )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[MaxWorkDays] ),
        FILTER ( 'Table', [RevenueMonth] = _month )
    )

 

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

How can I make this As card.  

Like this 
12:00pm Has the highest value
inside the card "Actual Value"

amitchandak
Super User
Super User

@Applicable88 , Create a measure like

 

measure =
var _max = maxx(allselected(Table), Table[RevenueMonth])
var _maxdt = maxx(filter(Table, Table[RevenueMonth] =_max),[Date])
return
calculate(sum(Table[TargetRevenue]), filter(Table, Table[Date] =_maxdt))

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

Hello @amitchandak,

thanks so far, but I already have target revenues for the whole year. That means the table is not ending in this month and I cannot get the value with MAX() function. Otherwise it give values for next year. I need a function where it really giving me the revenuetarget of current month. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.