Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello! I need if you can help me with the measure "% last 5" where I am trying to get the average percentage of the last accounting years, (Ejcontable column), the measure I use is as follows:
Example if filter by id 37 should give me a value of 17,36%. because if I add a filter of accounting exercises and choose the last 5 the value it gives me is 17.36% but instead it always gives me 100%.
Can you help me? Thank you.
Attached pbi.
Best regards.
Solved! Go to Solution.
Hi @Syndicate_Admin ,
In the EjContable column of other IDs, are there also these numbers 52, 53, 54, 55, 56? If so, tweak your formula to:
% last 5 =
VAR _max =
MAX ( data[EjContable] )
VAR _min = _max - 4
RETURN
CALCULATE (
[_participacion],
FILTER (
ALLSELECTED ( data ),
data[EjContable] >= _min
&& data[EjContable] <= _max
),
REMOVEFILTERS ( data[EjContable] )
)
In your formula, the ALL function take all ID into consideration, replace it to ALLSELECTED to try.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!
Best Regards,
Community Support Team _ kalyj
Hi @Syndicate_Admin ,
In the EjContable column of other IDs, are there also these numbers 52, 53, 54, 55, 56? If so, tweak your formula to:
% last 5 =
VAR _max =
MAX ( data[EjContable] )
VAR _min = _max - 4
RETURN
CALCULATE (
[_participacion],
FILTER (
ALLSELECTED ( data ),
data[EjContable] >= _min
&& data[EjContable] <= _max
),
REMOVEFILTERS ( data[EjContable] )
)
In your formula, the ALL function take all ID into consideration, replace it to ALLSELECTED to try.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
As I can not attach the pbi I add more information
How can I attach the pbix? It won't let me. Thank you.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
142 | |
80 | |
64 | |
52 | |
48 |
User | Count |
---|---|
213 | |
89 | |
77 | |
66 | |
60 |