Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Good day!
I would like to ask for your help regarding Percentage Difference Data based on selected slicer (per week and per month).
I am using 3 different slicers for my data (Month, Week, and Date) and this is the formula I am using for the Percentage Difference for Date/Day (see formula below)
Is it possible to include IF OR Condition for this formula If I only selects for Month or Week Slicer? How to input?
For Example: If I selected for the Month Slicer only, it will calculate for the percentage difference from the previous month. Same scenario when I select in the Week Slicer but if I selected for all 3 Slicers, For Example: Month: August, Week: 35, Date: Aug 26, the Percentage Difference will be from the previous day (Aug 25)
Thank you!
Here's the formula I am using for Percentage Difference per Day
Hi, @rkxiii
Can you provide some of the example data? And what you expect the output to be.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Thank you for the response.
Is it possible for you to combine those 2 formulas above?
Shravan133's formula gives wrong calculations for week and month percent difference.
Here's my expected output as I stated on my post: "If I selected for the Month Slicer only, it will calculate for the percentage difference from the previous month. Same scenario when I select in the Week Slicer but if I selected for all 3 Slicers, For Example: Month: August, Week: 35, Date: Aug 26, the Percentage Difference will be from the previous day (Aug 25)"
Thank you very much.
try this:
% Diff =
VAR SelectedDate = SELECTEDVALUE('Input Data'[Date])
VAR SelectedWeek = SELECTEDVALUE('Input Data'[Week])
VAR SelectedMonth = SELECTEDVALUE('Input Data'[Month])
VAR _PrevDate =
IF(
NOT(ISBLANK(SelectedDate)),
CALCULATE(
MAX('Input Data'[Date]),
FILTER(
ALLEXCEPT('Input Data', 'Input Data'[Model], 'Input Data'[Line]),
'Input Data'[Date] < SelectedDate
)
),
IF(
NOT(ISBLANK(SelectedWeek)),
CALCULATE(
MAX('Input Data'[Date]),
FILTER(
ALLEXCEPT('Input Data', 'Input Data'[Model], 'Input Data'[Line]),
'Input Data'[Week] < SelectedWeek && 'Input Data'[Month] = SelectedMonth
)
),
CALCULATE(
MAX('Input Data'[Date]),
FILTER(
ALLEXCEPT('Input Data', 'Input Data'[Model], 'Input Data'[Line]),
'Input Data'[Month] < SelectedMonth
)
)
)
)
VAR _PrevYield =
CALCULATE(
[Yield],
FILTER(
ALLEXCEPT('Input Data', 'Input Data'[Model], 'Input Data'[Line]),
'Input Data'[Date] = _PrevDate
)
)
RETURN
IF(
ISBLANK(_PrevYield),
BLANK(),
[Yield] - _PrevYield
)
test the dax with different combinations of slicers and modify the formula accordingly.
Hi, Thank you for your response. The only problem for this formula is that the accumulated weekly and monthly percentage difference is not accurate. I think it is not based on the previous week/month when I select for week/month slicer
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.