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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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