Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have the following scenario that I cannot solve, I need to build a matrix with the accumulated sales from the beginning of the calendar date to the maximum date selected .
But I also have a ETAPA dimension that has a temporality, that is, it was active between two dates.
My problem is that I cannot omit the accumulated sales when the ETAPA was not active in the selected year, so the sub-total of ETAPAS does not shows the expected quantity.
Since ETAPA 3 was only active until 2019, I would expect the subtotal to be 99 and the ETAPA 3 row to disappear from the matrix
The "Rolling Total Net Sales" was created using quick measure, the "Rolling Total Net Sales 2" is:
Solved! Go to Solution.
Hi,
Please try to combine your “Rolling Total Net Sales 2” measure and my original measure like this:
VNeta Acum 1 =
VAR _FechaInicio = FIRSTDATE(ALL(Calendario[Fecha]))
VAR _FechaFin = MAX(Calendario[Fecha])
VAR _FechaEtapa = MAX(PeriodoEtapas[PeriodoEtapas])
var _test = CALCULATETABLE(DISTINCT(Etapas[ID]),FILTER(Etapas,YEAR(Etapas[FechaFin])>=MIN(Calendario[Año])))
RETURN
CALCULATE(
[VNeta],
Calendario[Fecha] >= _FechaInicio,
Calendario[Fecha] <= _FechaFin,
Calendario[Fecha] <= _FechaEtapa,
ALL(PeriodoEtapas),PeriodoEtapas[IDEtapa] in _test
)
When you choose 2020, it shows:
When you choose other years, it shows correctly as well:
Hope this can help.
Best Regards,
Giotto Zhi
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Thank you Greg
Hi,
Could you please tell me the measure [VNeta] in your formula?
If you can share your pbix file by OneDrive for Business or give some table's sample data and any existing relationships, i will help you further.
Remember to remove any sensitive data.
Thanks.
Best Reagrds,
Giotto Zhi
Hi Giotto,
VNETA (Net Sales) = [Gross Sales] - [Cancellations] - [Returns]
Here is the Pbix File
Thank you in advance
Hi,
Please try this measure:
Measure =
var _test = CALCULATETABLE(DISTINCT(Etapas[ID]),FILTER(Etapas,YEAR(Etapas[FechaFin])>=MIN(Calendario[Año])))
return
CALCULATE([VNeta],ALL(PeriodoEtapas),PeriodoEtapas[IDEtapa] in _test)
The result shows:
Hope this can help.
Best Regards,
Giotto Zhi
Hi,
Please try to combine your “Rolling Total Net Sales 2” measure and my original measure like this:
VNeta Acum 1 =
VAR _FechaInicio = FIRSTDATE(ALL(Calendario[Fecha]))
VAR _FechaFin = MAX(Calendario[Fecha])
VAR _FechaEtapa = MAX(PeriodoEtapas[PeriodoEtapas])
var _test = CALCULATETABLE(DISTINCT(Etapas[ID]),FILTER(Etapas,YEAR(Etapas[FechaFin])>=MIN(Calendario[Año])))
RETURN
CALCULATE(
[VNeta],
Calendario[Fecha] >= _FechaInicio,
Calendario[Fecha] <= _FechaFin,
Calendario[Fecha] <= _FechaEtapa,
ALL(PeriodoEtapas),PeriodoEtapas[IDEtapa] in _test
)
When you choose 2020, it shows:
When you choose other years, it shows correctly as well:
Hope this can help.
Best Regards,
Giotto Zhi
Hi Giotto Zhi;
It works perfect!! thank you very much.
BR
Refer, if this can help
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |