Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello All ,
Here is my DAX measure - that return blank results.. Im trying just to get Previous month sales :
Solved! Go to Solution.
Hi @SammyBM - I have tested the sample data, Can you please try below measure and let us know.
Hope it helps.
Proud to be a Super User! | |
Hi @SammyBM ,
Here is my sample data:
I don't know if there is a relationship between your Calendar table and the Hashavshvet table, so I used a DAX that works fine with or without the relationship:
salePreviousMonth =
VAR _PreviousMonth = PREVIOUSMONTH('Calendar'[MonthYear])
VAR SalesAmount = CALCULATE(
SUM(Hashavshvet[sales]),
FILTER(
ALL(Hashavshvet),
Hashavshvet[SortCodeName] = "test" &&
Hashavshvet[FullName] = "meals" &&
Hashavshvet[AccountKey] = "800" && YEAR('Hashavshvet'[MonthYear]) = YEAR(_PreviousMonth) && MONTH('Hashavshvet'[MonthYear]) = MONTH(_PreviousMonth)
)
)
RETURN SalesAmount
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Dino , Something is weired. I know how to use time intl formulas, But somthing is getting wrong in my DAX - I've tried your suggsetion ( both calendar and hashavshvet connected via Date colum. But yet i can get previous month sales - Here my error :
"... A table of multiple values was suplied where s single value was expected "
Hi @SammyBM - I have tested the sample data, Can you please try below measure and let us know.
Hope it helps.
Proud to be a Super User! | |
Hi @SammyBM -As per above formaule shared, slight modification as below
I hope you already have a calendar table in your model
salePreviousMonth =
VAR _PreviousMonth = PREVIOUSMONTH('Calendar'[Date]) // Assuming 'Date' is your calendar date column
RETURN
CALCULATE(
SUM(Hashavshvet[sales]),
FILTER(
Hashavshvet,
Hashavshvet[SortCodeName] = "test" &&
Hashavshvet[FullName] = "meals" &&
Hashavshvet[AccountKey] = "800" &&
Hashavshvet[Date] IN _PreviousMonth // Ensure that you use the actual date field here
)
)
Hope it works, if still any please share sample data in text for further analysis.
Proud to be a Super User! | |
Thank you for the support !
The calendar table is set by month year interval , as the customer only wants to look on monthly data. so the monthyear is date.
i've tried your solution but is still bringing blank values.
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 |
|---|---|
| 53 | |
| 35 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 39 | |
| 35 | |
| 23 |