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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
v-eqin-msft
Community Support
Community Support

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
v-eqin-msft
Community Support
Community Support

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

v-eqin-msft
Community Support
Community Support

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))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.