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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
computermike
Helper I
Helper I

Dax, filter context

I saw a Dax query for current month Sales in this forum here...   Current Fisacal Sales Month

 

I used the same formula, but when I added a month filter in my Pivot table and changed the month to the previous month, my figures were blank.  I'd like to add have a month filter and change the month, but still see my currrent month sales.

 

Here is my dax 

 

Current Month Sales:=CALCULATE(
SUM(fSales[Amount]),
FILTER(
dDate,
dDate[Month]=MONTH(NOW())
&& dDate[Year]=YEAR(Now()) )
)

Anyone know how to do this???

 

 

Thanks,

 

Mike

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@computermike

 

Try this

 

Current Month Sales :=
CALCULATE (
    SUM ( fSales[Amount] ),
    FILTER (
        ALL ( dDate ),
        dDate[Month] = MONTH ( NOW () )
            && dDate[Year] = YEAR ( NOW () )
    )
)

 

 


Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@computermike

 

Try this

 

Current Month Sales :=
CALCULATE (
    SUM ( fSales[Amount] ),
    FILTER (
        ALL ( dDate ),
        dDate[Month] = MONTH ( NOW () )
            && dDate[Year] = YEAR ( NOW () )
    )
)

 

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
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.