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,
Example:- If the user chooses the date range slicer 03/1/2022 - 04/01/2022, make the table show the same date range for the prior 3 years, how should I make it.
Need your help!
Thanks,
Francis
Hi @Anonymous ,
Whether the advice given by @Jihwan_Kim has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.
Looking forward to your feedback.
Best Regards,
Henry
Hi,
I am not sure whether I understood your question correctly, but please check the below picture and the attached pbix file. I do not know how your data model looks like, but I tried to create a sample pbix file like below, and I hope the below can give some ideas on how to apply a similar calculated measrue to your data model.
Quantity desired outcome: =
VAR _prioroneyearrange =
DATEADD ( 'Calendar'[Date], -1, YEAR )
VAR _priortwoyearrange =
DATEADD ( 'Calendar'[Date], -2, YEAR )
VAR _priorthreeyearrange =
DATEADD ( 'Calendar'[Date], -3, YEAR )
VAR result =
CALCULATE (
SUM ( Data[Quantity] ),
KEEPFILTERS ( FILTER ( ALL ( Data ), Data[Date] IN _prioroneyearrange ) )
)
+ CALCULATE (
SUM ( Data[Quantity] ),
KEEPFILTERS ( FILTER ( ALL ( Data ), Data[Date] IN _priortwoyearrange ) )
)
+ CALCULATE (
SUM ( Data[Quantity] ),
KEEPFILTERS ( FILTER ( ALL ( Data ), Data[Date] IN _priorthreeyearrange ) )
)
RETURN
result
Still I'm not getting the desired output , Thank you
Hi Amit,
This scenario wouldn't helped me out
-Francis
@Anonymous , You can not default range slicer. You can use relative date slicer or a work around default column like
Year Type = Switch( True(),
year([Date])<= year(Today()) && year([Date])>= year(Today())-3,"Last 3 Years" ,
Format([Date],"YYYY")
)
Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |