The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
8 | |
8 |