Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Ivan_lopez
Frequent Visitor

delay registration for one year

Hi,

I am trying to shift the "DEF PREMIUMS" data by one year. The final premiums are calculated as follows:

DEF_Prem2021 = PROV_Prem_2022 - (PROV_Prem_2022 * Growth)

 

Ivan_lopez_0-1671198684720.png

For this reason I need to shift the final premiums by one year and for the last year to show PROV_Prem_2022.

I have tried to perform this transformation using PowerQuery but it has not been possible. I have created the following function:

Ivan_lopez_1-1671198881307.png

Expected final result

 

Ivan_lopez_0-1671200433618.png

I would appreciate any help.

Thank you in advance, 

 

Iván.

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @Ivan_lopez ,

Could you please provide some raw data in your fact table(exclude sensitive data)? Are the field [Year], [Prov] and [Grotwh] from the same table 'Fact Total'? If the matrix involves any measure, please also provide the related formula. Thank you.

yingyinr_0-1671442979780.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I need to do the following calculations:

- YEAR > 2021: Def Premiums 2021 = Prov_Prem_2022 - (Prov_Prem_2022 * Growth) and for the last year indicate that Def_Prov2022 = Def_Prem2022.

- YEAR <= 2020: Def Premiums 2020 = Def Premiums 2020

I have tried with both calculated columns and DAX metrics but I have not been able to

 

AñoCod_DGSCrecimientoDGS_AÑO_KeySum of Primas emitidas (PROV)Sum of Primas emitidas (DEF)Sum of Primas emitidasSum of Primas Def Año Ant
1/1/2019 0:00C01570C0157-2020449177899.2449177899.2449.1778992449.1778992
1/1/2020 0:00C01570C0157-2020451616876.7451616876.7451.6168767451.6168767
1/1/2021 0:00C01570.031898588C0157-2021466022817.40466.0228174451.1573475
1/1/2022 0:00C01570.05C0157-2022495323958.30495.3239583470.5577604
        

 

Ivan_lopez_0-1671531151556.png

Best Regards,

 

Iván.

 

FreemanZ
Super User
Super User

hi @Ivan_lopez 

avoid use VAR here, try like

CALCULATE(SUM(), DATEADD())

 

Varible in DAX is more like a constant: once defined, never changes. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors