Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a formula that is going beyond the time I want it to. How should I limit the formula to fall in to the scope of the past to now and not in the future. The formula is as shown below.
SPLY INVoiced =
CALCULATE(
[Invoice Line TOtal],
SAMEPERIODLASTYEAR('Date'[Date])
)
The visual shows the formula in action. Since it is the sameperiodlastyear, it shows the formula going forward to 2024. I want it to show up to May 2023. How do I limit the Orange line to be span upto May 2023, the current time.
Solved! Go to Solution.
I have tried to limit it as shown below, still does not work. Any suggestions?
SPLY INVoiced =
Var Month = MONTH(TODAY())
return
CALCULATE(
[Invoice Line TOtal],SAMEPERIODLASTYEAR('Date'[Date]),FILTER('INV1 Invoice Rows', 'INV1 Invoice Rows'[DocDate] <= TODAY()
))
Hi @Datagulf ,
Please try:
SPLY INVoiced =
VAR _a =
CALCULATE ( [Invoice Line TOtal], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
RETURN
IF ( SELECTEDVALUE ( 'Date'[Date] ) <= EOMONTH ( TODAY (), 0 ), _a )
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have tried to limit it as shown below, still does not work. Any suggestions?
SPLY INVoiced =
Var Month = MONTH(TODAY())
return
CALCULATE(
[Invoice Line TOtal],SAMEPERIODLASTYEAR('Date'[Date]),FILTER('INV1 Invoice Rows', 'INV1 Invoice Rows'[DocDate] <= TODAY()
))
Hi @Datagulf ,
Please try:
SPLY INVoiced =
VAR _a =
CALCULATE ( [Invoice Line TOtal], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
RETURN
IF ( SELECTEDVALUE ( 'Date'[Date] ) <= EOMONTH ( TODAY (), 0 ), _a )
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
55 | |
38 | |
29 |
User | Count |
---|---|
78 | |
62 | |
45 | |
40 | |
40 |