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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
azaterol
Helper V
Helper V

Sales of the month february

Hello everyone,

 

I want to automatically calculate the sales in the month of February. Here is my preliminary DAX. How can I target the end of the month of February due to the leap year. In other words, it doesn't matter whether February has 28 or 29 days, it should always calculate sales until the end of February.

Umsatz feb auto = SUMX(FILTER(AUDOK,AUDOK[DokDatum]>=DATE(YEAR(TODAY()),2,1) && AUDOK[DokDatum]<=Date(YEAR(TODAY()),2,29)),[Umsatz])

 

 

Thank you for any help.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@azaterol 

Use this measure:

Umsatz feb auto =
VAR __MonthFebStart =
    DATE ( YEAR ( TODAY () ), 2, 1 )
VAR __MonthFebEnd =
    EOMONTH ( __MonthFebStart, 0 )
RETURN
    SUMX (
        FILTER (
            AUDOK,
            AUDOK[DokDatum] >= __MonthFebStart
                && AUDOK[DokDatum] <= __MonthFebEnd
        ),
        [Umsatz]
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@azaterol 

Use this measure:

Umsatz feb auto =
VAR __MonthFebStart =
    DATE ( YEAR ( TODAY () ), 2, 1 )
VAR __MonthFebEnd =
    EOMONTH ( __MonthFebStart, 0 )
RETURN
    SUMX (
        FILTER (
            AUDOK,
            AUDOK[DokDatum] >= __MonthFebStart
                && AUDOK[DokDatum] <= __MonthFebEnd
        ),
        [Umsatz]
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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