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
Anonymous
Not applicable

Cómo obtener el cambio de Trimestre Fiscal sobre Qtr

Hola, chicos

¿Puede por favor ayudarme cómo puedo obtener Trimestre Fiscal sobre Trimestre cambio %. Tengo datos como abajo
2016-Q1 --> 100
2016-Q2 --> 200
2016-Q3 --> 300

2016-Q4--> 400

2017-Q1 --> 150
2017-Q2 --> 250
2017-Q3 --> 350

2017-Q4--> 450

Necesito calcular 2016Q1 con 2017-Q1 y así sucesivamente..
También como mencioné esto son qtr fiscal por lo que la fecha de inicio y la fecha de finalización no será el mismo Q1 comenzar a partir de abril y Q4 qtr termina en mar.



Avísame cómo lograrlo.

Gracias de antemano.

2 REPLIES 2
Greg_Deckler
Super User
Super User

@GJain No está muy claro si tienes fechas reales o sólo esas cosas del cuarto de año. Si sólo el año-trimestre cosas, usted podría hacer:

Measure = 
  VAR __Value = MAX('Table'[Value])
  VAR __Current = MAX('Table'[YearQuarter])
  VAR __CurrentYear = LEFT(__Current,4) * 1.
  VAR __CurrentQuarter = RIGHT(__Current,2)
  VAR __PreviousYear = IF(__CurrentQuarter="Q1",__CurrentYear - 1,__CurrentYear)
  VAR __PreviousQuarter = 
    SWITCH(__CurrentQuarter,
      "Q1","Q4",
      "Q2","Q1",
      "Q3","Q2",
      "Q3"
    )
  VAR __PreviousYearQuarter = __PreviousYear & "-" & __PreviousQuarter
  VAR __PreviousValue = MAXX(FILTER('Table',[YearQuarter]=__PreviousYearQuarter),[Value])
RETURN
  (__CurrentValue - __PreviousValue)/__PreviousValue

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@GJain , en caso de que tenga tabla de fechas puede utilizar datesqtd.

De lo contrario, cree una tabla qtr y cree Rank

Qtr Rank á RANKX(all('Date'),'Date'[Qtr],ASC,Dense) // YYYY QQ debería caber aquí, pero tener una tabla separada
Este Qtr - CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]-max('Date'[Qtr Rank])))
Last Qtr á CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]-max('Date'[Qtr Rank])-1))

si tienes fecha entonces

Ventas de QTD: CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales ? CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

Power BI — QTD
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839

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.