Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
I have pulled in some tables from an actively used Access database which has one table reporting on values of checks which we receive. I want to create two measures from this table which I can use on cards which will show a total for the previous month and a total for the current month.
I do have a MASTER date table called Calendar_Dates and have created a relationship from this master date table to the tblIncomingCommissions Pay-Date.
I tried the following DAX for the current month, but it's telling me I have to many arguments.
Solved! Go to Solution.
@emma313823
Filter accepts only one argument, If you need to provide 2 arguments(month and year) you need to use &&.
Also for previous month use below dax.
Prevmonth = =
CALCULATE(
SUM('tblIncomingCommissions'[Check_Value]),
FILTER(
'Calendar_Dates',
MONTH('Calendar_Dates'[Date]) = MONTH(TODAY())-1 &&
YEAR('Calendar_Dates'[Date]) = YEAR(TODAY())
)
)
But this will remain static(change each month automatically), But if you want the user to select what the current month is. Then create two slicers for year and month. When use select a year and a month the below dax will give current and previous month.
CM = SUM('tblIncomingCommissions'[Check_Value])
Previous month = calculate(CM,
Hi @emma313823
please try below DAX.
CurrentMoComm =
CALCULATE(
SUM('tblIncomingCommissions'[Check_Value]),
FILTER(
'Calendar_Dates',
MONTH('Calendar_Dates'[Date]) = MONTH(TODAY()) &&
YEAR('Calendar_Dates'[Date]) = YEAR(TODAY())
)
)
If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!
Follow me on LinkedIn!!
Could you help me a bit understanding what I did wrong?
@emma313823
Filter accepts only one argument, If you need to provide 2 arguments(month and year) you need to use &&.
Also for previous month use below dax.
Prevmonth = =
CALCULATE(
SUM('tblIncomingCommissions'[Check_Value]),
FILTER(
'Calendar_Dates',
MONTH('Calendar_Dates'[Date]) = MONTH(TODAY())-1 &&
YEAR('Calendar_Dates'[Date]) = YEAR(TODAY())
)
)
But this will remain static(change each month automatically), But if you want the user to select what the current month is. Then create two slicers for year and month. When use select a year and a month the below dax will give current and previous month.
CM = SUM('tblIncomingCommissions'[Check_Value])
Previous month = calculate(CM,
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 44 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |