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.
Hello,
I have created a measure that show the sales of the last quarter and works fine, but when I use a slicer to filter by the number day of the month it keeps showing the sales of the entire month. Does anyone know how to adapt the measure to fix this?
Example:
This shows correctly the sales of the last quarter
But for example if I filter to see the sales for just the first 10 days for every month of every quarter, it keeps showing the same information in the sales in the last quarter, and that's not correct.
Measure craeted:
Thanks in advance!
Sample:
https://drive.google.com/drive/folders/1TOYezhAuiy0ADTNcKVL1ayNw5XoLMo_I?usp=share_link
Solved! Go to Solution.
Hi @Laocsulak ,
Please have a try.
Change the quanter column.
QUANTER = var _year=YEAR(Sheet1[created])
var _year1=YEAR(Sheet1[created])-1
var _q=QUARTER(Sheet1[created])
var _qa=QUARTER(Sheet1[created])-1
var _1re=
_year&"/"&"Q"&_qa
return
IF(_q=1,_year1&"/"&"Q"&4,_1re)
and it is affected by the slicer.
If it still does not help,Please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Laocsulak ,
Please have a try.
Create columns and measures.
QUANTER =
VAR _year =
YEAR ( Sheet1[created] )
VAR _q =
QUARTER ( Sheet1[created] )
RETURN
_year & "/" & "Q" & _q
DAYS = DAY(Sheet1[created])
Measure:
Measure =
CALCULATE (
SUM ( Sheet1[amount] ),
FILTER (
ALL ( Sheet1 ),
Sheet1[DAYS] <= MAXX ( ALLSELECTED ( Calendario ), Calendario[Dia] )
&& Sheet1[QUANTER] = SELECTEDVALUE ( Calendario[Año/trimestre] )
)
)
How to Get Your Question Answered Quickly
If it still does not help,Please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the answer, although I have tried that and it shows the sales of the current quarter, I need to show the sales of the previous quarter, and also it's not affected by the slicer.
Hi @Laocsulak ,
Please have a try.
Change the quanter column.
QUANTER = var _year=YEAR(Sheet1[created])
var _year1=YEAR(Sheet1[created])-1
var _q=QUARTER(Sheet1[created])
var _qa=QUARTER(Sheet1[created])-1
var _1re=
_year&"/"&"Q"&_qa
return
IF(_q=1,_year1&"/"&"Q"&4,_1re)
and it is affected by the slicer.
If it still does not help,Please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Laocsulak , Try if measure like this can help
trailing QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,QUARTER))
I have tried that measure before, but when the quarter has not ended, it doesn't show the right amount for the previous quarter. In this example, it shows 10 instead of 24 in the last quarter.
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 |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |