cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Dynamic (Years, quarters, months) with dynamic YoY, QoQ, MoM

Hi,

I have a Matrix with the following aspect:

 

Matrix_ok_2.JPG

With the upper filter I can chose between Year, Quarter or Month and everything works fine:

 

Matrix_ok.JPG

The problem is that I would like to show the headers with the following format:

Year -> 2017, 2018, 2019....

Quarter -> 2017-Q1, 2017-Q2...

Month -> 2017-01, 2017-02...

 

For this purpose I change the Value column from my auxiliar Dim_Table:

 

Date table.jpg

Here the Matrix table works fine with the "Total Tickets" and "Percentage" measures:

 

Total_Tickets_PreviousYear =
CALCULATE(
DISTINCTCOUNT('Volume Creados'[TaskID]);PREVIOUSYEAR(dim_Date_freq[Value]))

 

 

5 REPLIES 5
Highlighted
Microsoft
Microsoft

Re: Dynamic (Years, quarters, months) with dynamic YoY, QoQ, MoM

Hi @ruanolin ,

You can create one measure as below:

Measure =
SWITCH (
    MAX ( 'Format'[Attribute] ),
    "Year", CONCATENATE ( YEAR ( MAX ( 'Format'[Value] ) ), "" ),
    "Quarter", CONCATENATE (
        YEAR ( MAX ( 'Format'[Value] ) ),
        CONCATENATE ( "-Q", QUARTER ( MAX ( 'Format'[Value] ) ) )
    ),
    "Month", CONCATENATE (
        YEAR ( MAX ( 'Format'[Value] ) ),
        CONCATENATE ( "-", MONTH ( MAX ( 'Format'[Value] ) ) )
    )
)

Best Regards

Rena

 

Highlighted
Helper I
Helper I

Re: Dynamic (Years, quarters, months) with dynamic YoY, QoQ, MoM

Hi @yingyinr 

I can't put a Measure in a Column of a Matrix table and if I try with a new calculate column the "Previous Year" measure disapears:

 

Error_3.JPG

 

 

 

Highlighted
Microsoft
Microsoft

Re: Dynamic (Years, quarters, months) with dynamic YoY, QoQ, MoM

Hi @ruanolin ,

The newly added measurement value or calculated column is recognized as a text value , it is no longer a date value . Hence the Time-intelligence function PREVIOUSYEAR will not work . If you want to calculate Total_Tickets_PreviousYear , you can update your previous formula as below :

Total_Tickets_PreviousYear =
CALCULATE (
    DISTINCTCOUNT ( 'Volume Creados'[TaskID] );
    PREVIOUSYEAR ( dim_Date_freq[Date] )
)

 

Best Regards

Rena

 

Highlighted
Helper I
Helper I

Re: Dynamic (Years, quarters, months) with dynamic YoY, QoQ, MoM

Hi @yingyinr ,

 

Your furmula is the initial measure that I show in the post and it doesn't work.

 

Error_3.JPG

 

I thing that I need a diferent measure to calculate the PreviousYear metric.

 

Highlighted
Microsoft
Microsoft

Re: Dynamic (Years, quarters, months) with dynamic YoY, QoQ, MoM

Hi @ruanolin ,

Could you please provide your pbix file if it is convenient? Thank you.

 

Best Regards

Rena

 

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Kudoed Authors