March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have two main calculated columns.
The first one is for calculate using the SAMEPERIODLASTYEAR function.
AnoPre = CALCULATE(SUM(vw_VariacaoTotalResiduosXCategoria[Peso(t)]); SAMEPERIODLASTYEAR(DatasParaBI[Date]))
And the variation expression
Δ = IFERROR((SUM(vw_VariacaoTotalResiduosXCategoria[Peso(t)]) - [AnoPre])/SUM(vw_VariacaoTotalResiduosXCategoria[Peso(t)]);BLANK())
The table DatasParaBI is my date table and the vw_VariacaoTotalResiduosXCategoria is my SQL view that return my data.
It works good when see the grid for months and years.
But for quarter view, some how, AnoPre sums all value from last period and actual period and my variation gets a wrong value.
For this item on first quarter period (months 1, 2 and 3 from 2016) should return 43.939,737. But its summing with 86.005,83 (actual first quarter period from 2017).
Maybe its something wrong with my AnoPre column?
Solved! Go to Solution.
Hi @Onaiggac,
According to your description above, I think the measure AnoPre is correct, and it should work. The problem should be related to your Quarter column.
From the screenshots you posted above, you have a month called "Jan/17" for 2017 Jan, but the quarter "First" for 2017 Q1? Shouldn't it be "First/2017"? So you may need to change the values for Quarter correctly to make it work.
Regards
Hi @Onaiggac,
According to your description above, I think the measure AnoPre is correct, and it should work. The problem should be related to your Quarter column.
From the screenshots you posted above, you have a month called "Jan/17" for 2017 Jan, but the quarter "First" for 2017 Q1? Shouldn't it be "First/2017"? So you may need to change the values for Quarter correctly to make it work.
Regards
Sure.
Because the actual column and last pariod column has the same name and thats why its summing.
Its working.
Tks.
Now I having a problem to use filter. Its says something like "Exception generated by IDataReader interface."
But I will create another post https://community.powerbi.com/t5/Desktop/SAMEPERIODLASTYEAR-with-filter-return-error-message/td-p/22...
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
90 | |
90 | |
66 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |