Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Background: I have three tables: 1) Time Selection 2) Month 3) FactTable. I'm using Time Selection to filter down the Month table so that the user can dynamically filter between Calendar Years and Fiscal Years.
Issue: I'm trying to calcuate a yearly total that is dynamic between Calendar and Fiscal Years. My initial formula for this is:
Values Sum: Yearly = CALCULATE([Values Sum], ALLEXCEPT('Year Selection', 'Year Selection'[Year], 'Year Selection'[Time Period]))
The issue arises when attempting to view this measure using fields from the Month table (such as quarter). When the above measure is added to a visual, all filtering from the Year Selection table is ignored. This results in the value being repeated for each line as if there is not a relationship between Year Selection and Month.
Is there a way to calculate a Yearly total in this situation while still maintaining the relationship between tables?
Solved! Go to Solution.
Hi @avtle ,
Allexcept() removes all context filters in the table except filters that are applied to the specified columns, the year should naturally be start from 2017 to 2020 in your visual.
When you apply the slicer,,for example 2020 the sum will show the corresponed value, other year values are blank and the yearly sum will always show from 2017 to 2020.
Use if statement is a alternative workaround, but if you think it is inefficient, you can use the visual filter to set the sum value is not blank to get the same result.
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
The Year column from the Year Selection table is not used in your visual. Is that correct? To remove the filters from the Year and Quarter columns used in the visual, you can use this expression.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @mahoneypat, thanks for the response.
The Year column is not used, but I would like to use this measure in other scenarios to show the yearly sum.
I have created a work around function:
var x = ISBLANK(MIN('Year Selection'[Year Month]))
return
IF(x,BLANK(),CALCULATE([Values Sum], ALLEXCEPT('Year Selection', 'Year Selection'[Year], 'Year Selection'[Time Period])))
Hi @avtle ,
Allexcept() removes all context filters in the table except filters that are applied to the specified columns, the year should naturally be start from 2017 to 2020 in your visual.
When you apply the slicer,,for example 2020 the sum will show the corresponed value, other year values are blank and the yearly sum will always show from 2017 to 2020.
Use if statement is a alternative workaround, but if you think it is inefficient, you can use the visual filter to set the sum value is not blank to get the same result.
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Using an IF is fine if the result is performant for your application. If you see sluggish response with slicer selections, you can evaluate alternatives. Now that I see your two charts, I get more of what you are trying to do. I think it would be simpler to have a Date table that also has a Fiscal Year column in it that you can use in the slicer. I think this video might be helpful.
https://www.youtube.com/watch?v=1-agbCF7HwY
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @Anonymous,
Thanks for your response. The video does not seem to address the concern I have here. I tried both the ALLSELECTED and SUMX solutions he presented.
Baseline, I am looking to trim this chart so that the axis is still filtered by the axis when the yearly total is added.
Chart without yearly total (filters working properly):
Chart with yearly total (filters not working properly):
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |