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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Help using secondary relationship and previous month

Hello!

I don't understand why my measure isn't working.

I need to show my client how he did in relation to the previous month, the visualization will show the entire year.

 

I only had a text column with the name of the month, so I created a column that shows the date like the first day of the month to create the relationship between my date table and this table.

My measure must be wrong somewhere because it shows 100% for everything, when 01/10/2019 should show -2% and so on.

% OK =

DIVIDE(

               [Total ok]

             , [Total]

)

 

Variation =
VAR PREVIOUS_MONTH =
          CALCULATE(
                                  [% OK]
                                  , PREVIOUSMONTH('d_Calendário'[Data])
           )
VAR CURRENT_MONTH = [% OK]
VAR DIFF = CURRENT_MONTH - PREVIOUS_MONTH
              RETURN
              DIVIDE(
                             DIFF
                             ,  CURRENT_MONTH
)+0

 

Variation | % OK | Month

can anyone help me?

Captura de tela 2021-01-25 151926.png

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , This seem like correct formula , make sure this (d_Calendário) is a date table and also marked as date table , right click mark as date table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.