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
I'm looking to see if there is a way to take the difference between two variables 1. average sales in 2019 and 2020 for product B-A 2. sales in "x" year for product M-A, where "x" would be determined by the user looking at the dashboard (either 2019,2020,2021,2022,2023, etc.)
I've tried to create measures, but when I use a slicer to determine variable number 2, the slicer is also applied to variable 1. If I create a column, variables 1 and 2 are fixed, meaning I cannot change the sales year.
Below is the measure I've created:
Solved! Go to Solution.
Try changing the first calculate to this:
CALCULATE(
SUM( 'PL Portfolio'[Trace Units] ),
'PL Portfolio'[Fiscal Year] <= 2020,
ALL( 'PL Portfolio'[Fiscal Year] ),
'PL Portfolio'[B & M] = "B - A"
)
Hi @orana !
I dont know your code, but it seems that adding ALL( Date[Year] ) to variable 1 could fix the problem, adding this would make your varable 1 not be affected by your Year slicer. Make sure that the column you use on your slicer is the same that you use inside ALL().
Let me know if this helps! If it is not clear enought, please make sure to provide us the code so its easier to solve the problem.
Hey @Pablo ,
I revised my post with the measure that I currently have. Let me know if this helps
Best,
Oscar
Try changing the first calculate to this:
CALCULATE(
SUM( 'PL Portfolio'[Trace Units] ),
'PL Portfolio'[Fiscal Year] <= 2020,
ALL( 'PL Portfolio'[Fiscal Year] ),
'PL Portfolio'[B & M] = "B - A"
)
The measure is not working. If I use my slicer and click 2021, the measure returns blank.
Hi @orana ,
I was able to return the correct result using the formula from PabloDeheza . Could you please share your example data? That will help us solve the problem faster.
Best Regards,
Winniz
Hey,
I just got it to work. I was using another Fiscal Year for the slicer, which is what was driving the "blank".
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |