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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Lakshmi1294
Frequent Visitor

DAX Function to find out First 7 days sales of present month

Hi ,

 

I'm Trying to get the current month First 7 days sales to be comparing with lst month First 7 Days

 

In my data last month is June-2015 (Need to get 1st June-7th June Sales)

 

Can anyone please help me in this

 

Thanks in adavance

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @Lakshmi1294 

Thanks for reaching out to us.

I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

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

PaulDBrown
Community Champion
Community Champion

Do you have a date table?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Yes 

Try:

7 days sales vs last month =
VAR _DTYM = DateTable[Year] * 100 + DateTable[Month Number]
VAR _CYM =
    YEAR ( TODAY () ) * 100
        + MONTH ( TODAY () )
VAR _LYM =
    IF (
        MONTH ( TODAY () ) = 1,
        ( YEAR ( TODAY () ) - 1 ) * 100 + 12,
        YEAR ( TODAY () ) * 100
            + ( MONTH ( TODAY () ) - 1 )
    )
VAR _CurrentMonth =
    CALCULATE (
        [Sum sales],
        FILTER ( ALL ( DateTable ), DAY ( DateTable[Date] ) < 8 && _DTYM = _CYM )
    )
VAR _LastMonth =
    CALCULATE (
        [Sum sales],
        FILTER ( ALL ( DateTable ), DAY ( DateTable[Date] ) < 8 && _DTYM = _LYM )
    )
RETURN
    _CurrentMonth - _LastMonth

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.