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
AHS2019
Frequent Visitor

Help Please trying to replicate a variance analysis in Power BI

I am trying to replicate a time intelligence based variance analysis of the data which is over a 12 month period.

I would like my report to show the view for the current month vs the prior month however the report displays all the months in the data as screenshot below:

Report Error.JPG

 

I would also like for the month on month vairance to show as one column for the current month and the previous month, however the quick measure i have created shows a variance column for each month even when a slicer has been added it will display a column for each month selected

 

My ideal visual would be as below 

Ideal Visual.JPG

 

 

1 ACCEPTED SOLUTION

Hi,

That will happen.  If you select 2 months in the slicer/filter, then for each month there will be a variance column.  As regards, the second question, i suggest you try the following measures:

Total = SUM('SAP DATA'[Amt **bleep**.lc.cur])

Total in previous month = CALCULATE([Total],PREVIOUSMONTH('Datekey'[Date]))

Growth over previous month = IFERROR([Total]/[Total in previous month]-1,BLANK())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Select the months via a slicer.  Wouldn't that work?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  No this doesnt seem to work as this still displays a column for January variance against the previous month for which there is no data as this relates to the previous financial year.

 

Slicer.JPG

 

I also have a error message in my time intelligence based measure for my Month on month variance measure, could this be an issue?

 

 MoM% =
IF(
    ISFILTERED('Datekey'[Date]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('SAP DATA'[Amt **bleep**.lc.cur]),
            DATEADD('Datekey'[Date].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(SUM('SAP DATA'[Amt **bleep**.lc.cur]) - __PREV_MONTH, __PREV_MONTH)

 

Apologies if I seem like I dont kno what I am talking about I am quiet new to this and very much in learning phase at the moment

Hi,

That will happen.  If you select 2 months in the slicer/filter, then for each month there will be a variance column.  As regards, the second question, i suggest you try the following measures:

Total = SUM('SAP DATA'[Amt **bleep**.lc.cur])

Total in previous month = CALCULATE([Total],PREVIOUSMONTH('Datekey'[Date]))

Growth over previous month = IFERROR([Total]/[Total in previous month]-1,BLANK())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for your reply.

 

However the meausres recomeneded are not providing the desired visuals as they are listing row data with no values.

 

So there is no workaround this (That will happen.  If you select 2 months in the slicer/filter, then for each month there will be a variance column)

What do you mean by "meausres recomeneded are not providing the desired visuals as they are listing row data with no values"?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  Please ignore my previous post. That was exactly what I required.

 

Thank you for your help and assistance its greatly appreciated. 

You are welcome.  If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.