Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
I have 3 different table CL (end date, contract id), sales actual ( #actual, dateid, contract id, doc date), and calendar (dateid, year, month, date).
They are related like the photo below.
What I want is that, when I select a month year from calendar, to have sales actual where the End date from CL is until the month before the selected month.
do you have any idea on how to solve it?
thank you very much for your help
Solved! Go to Solution.
Hi @Bwendos_Den ,
The sample measure below will calculate the sales up to before the earliest date of the selected month from the calendar table.
CALCULATE (
[sales measure],
FILTER ( ALL ( 'calendar' ), 'calendar'[Date] < MIN ( 'calendar'[Date] ) )
)
Take note, the sales will be cumulative from the earlierst transaction date. If for just the current year, try:
CALCULATE (
[sales measure],
FILTER (
ALLEXCEPT ( 'calendar', 'calendar'[YEAR] ),
'calendar'[Date] < MIN ( 'calendar'[Date] )
)
)
Hi @danextian thanks for your answer but it is not what what I am looking for, with that I still get the current month
Mmm. That is unexpected. Can you please post a workable sample data (not an image) or a sanitized copy of your pbix. You can post a link to a file in the cloud.
Hi @Bwendos_Den ,
The sample measure below will calculate the sales up to before the earliest date of the selected month from the calendar table.
CALCULATE (
[sales measure],
FILTER ( ALL ( 'calendar' ), 'calendar'[Date] < MIN ( 'calendar'[Date] ) )
)
Take note, the sales will be cumulative from the earlierst transaction date. If for just the current year, try:
CALCULATE (
[sales measure],
FILTER (
ALLEXCEPT ( 'calendar', 'calendar'[YEAR] ),
'calendar'[Date] < MIN ( 'calendar'[Date] )
)
)
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 |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |