Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have a measure and need to apply it a filter condition when the User filter a month the value of the measure need to be maintained even if the value used in the measure has no relationship with the month table, for example I have the following expression in QlikView: sum ({$ <Month =>} Vl_ReceitaPrevista)
In power bi I have sum (Vl_ReceitaPrevista).
How would I do this in power bi?
Solved! Go to Solution.
It sounds like you need an ALL or ALLEXCEPT clause in your SUM calculation. Generally, you do this by wrapping the SUM in a CALCULATE like:
CALCULATE(SUM(VI_ReceitaPrevista),ALL(table))
Basically, the ALL and ALLEXCEPT clauses create an context for the SUM that is independent of other contextual filters that may be applied, like from slicers. Can't really get too specific without sample data.
It sounds like you need an ALL or ALLEXCEPT clause in your SUM calculation. Generally, you do this by wrapping the SUM in a CALCULATE like:
CALCULATE(SUM(VI_ReceitaPrevista),ALL(table))
Basically, the ALL and ALLEXCEPT clauses create an context for the SUM that is independent of other contextual filters that may be applied, like from slicers. Can't really get too specific without sample data.
Did a test here after I applied the solution, calcaulate function (all ()) solves the problem of being presented zero when filtered dimension in my case a month dimension however when it is filtered a month that there was change and the value is not changed, for example, in January there was no movement and so when filtered it is presented to zero and should be shown the total value of the year with the function all this problem was solved however when I filter the month of February there was drive the still displayed value is the total of the year and in fact should be presented the value of the current year in February.
Briefly function cancels all the filter made of the size I expecificar the expression, in this case how could I fix this?
Follow my expression:
Budgeted Current = CALCULATE (if (ISBLANK (Sum (Facts [Budgeted Initial]) + Sum (Facts [Vl_Suplementado]) - Sum (Facts [Vl_Reduzido])); 0; (Sum (Facts [Budgeted Initial]) + Sum (Facts [Vl_Suplementado]) - Sum (Facts [Vl_Reduzido]))), ALL (DMEGF_Mes [Month]))
Try changing your ALL to ALLEXCEPT, see documentation here:
https://msdn.microsoft.com/en-us/library/ee634795.aspx
You may have to add some columns to your ALLEXCEPT clause. It is really difficult to be specific without sample data and your expected output. ALLEXCEPT removes all context filters except for the ones that you specify in the ALLEXCEPT function.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |