Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
When I select a date range then i want to get the sales that What was befpre 3 month sales and after 3 month sales
Let say i selected 01June to 30 June 2021 then i need to shwo in my stacked area graph that on this selected date range from date table
So sin chart i will put month , i need sales when i select this date it shoudl give me march,april,may i.e (before 3 month) and june,july,august after 3 month like thiss
So on selected date range i need sales of that range beofre 3 month and thsi 3 month,
Hi, @bilalkhokar73 ;
Is the above answer helpful to you? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @bilalkhokar73 ;
You could create a date table as a slicer, and then create a measure.
Rolling =
VAR _per =
EOMONTH ( MIN ( 'slicer'[Date] ), -3 )
VAR _last =
EOMONTH ( MAX ( 'slicer'[Date] ), 3 )
RETURN
CALCULATE (
SUM ( [value] ),
FILTER (
ALL ( 'Table' ),
[Date] <= MAX ( [Date] )
&& [Date] >= DATE ( YEAR ( _per ), MONTH ( _per ), DAY ( MIN ( 'slicer'[Date] ) ) )
&& [Date]<= DATE ( YEAR ( _last ), MONTH ( _last ), DAY ( MAX ( 'slicer'[Date] ) ) ))
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@bilalkhokar73 , if you wanted data rolled at jun then
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD("Date"[Date ],eomonth(MAX("Date"[Date ]),-3)+1,6,MONTH))
If you want a trend then you need to use an independent date table
Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE
I have date table, In my sales table I donto have data of april and may , then also it is givign me data fo april,may and dat comign wrong
I need when i select June then last 3 monht and next 3 month sales june will be included in next 3 month
Let say I seleted date from 15th june to 30 th june then data will come from 15th march to 15 april,15april to 15 may like this ....
Desired result format
@bilalkhokar73 ,remove eomonth , try like
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD("Date"[Date ],MAXX("Date",dateadd("Date"[Date],-3,month)),6,MONTH))
@amitchandak
I have tried this but when i select july then it givess me only july sales
I need when july select then july last 3 month and next 3 month like that
#Datesvprjt =
var a=IF(ISFILTERED(Sales[Odate]),CALCULATE(sum(Sales[Amt]),FILTER(date,date[Date]>=MAX(Sales[Ordt])-90 && date[Date]<=MAX(Sales[Ordt])+90)),0)
var b=CALCULATE(sum(Sales[Amt]),ALL(Sales[Amt]))
return IF(ISFILTERED(Sales[Ordt]),a,b)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |