The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi there, I'm facing with the following problem.
I need to create an Last Year measure.
then I created a calculated group like this:
v_dim_time and v_fact_sales are related to 1:n
var DayToCompare = today()
var DateLastYear = EDATE(DayToCompare;-12)
return
calculate(
SELECTEDMEASURE ();
year(v_DIM_TIME[CALENDAR_DATE_SQL]) = Year(DateLastYear);
v_DIM_TIME[CALENDAR_DATE_SQL] <= dateLastYear
)
My problem is how can I to made the formula dynamical, saying for example that ytd will be evaluated at today - 365 if no other selection are made by time slicer otherview keeping the value selected ?
Thank you in advance
Solved! Go to Solution.
@Anonymous
Using ISFILTERED() function you can identify if the column is filtered or not. Based on that, you can switch your logic.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Hi @Anonymous ,
Can you please share the sample data and expected output.
Have calculated values where the column changes dynamically i.e shows Total Cost incase Filter in not selected and shows Total Sales if the filter is selected.
The Date Slicer is from the Calendar Table.
@Anonymous
Using ISFILTERED() function you can identify if the column is filtered or not. Based on that, you can switch your logic.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
19 | |
18 | |
15 | |
11 |
User | Count |
---|---|
35 | |
34 | |
19 | |
19 | |
14 |