Forum Discussion

PowerBIBunny's avatar
PowerBIBunny
New Member
3 months ago
Solved

Need help getting a percentage change working

Hi all,

 

I have created a dax measure to calculate a total home number - thats fine.

However when tryign to calculate a percentage change over two quaters the dax measure keept returnign the total home count and not the numbers for each quater. What is wrong with my percentage measure?

--my total home measure below

 

number of homes =
var good = SUM('Quality Data'[4) Good - Number])
var inadequate = SUM('Quality Data'[4) Inadequate - Number])
var outstanding = SUM('Quality Data'[4) Outstanding - Number])
var improvement_needed = SUM('Quality Data'[4) Requires Improvement - Number])
var result = good+inadequate+outstanding+improvement_needed
RETURN
result
 
---my percentage change measure below
Percentage Change Homes =

var previous = CALCULATE(
    [number of homes],
    'Quarterly Data - ALL LA'[Quarter & Year] = "Q1 2026")

var _current = CALCULATE(
    [number of homes],
    'Quarterly Data - ALL LA'[Quarter & Year]= "Q2 2026")

Var difference = (_current - previous)/previous
RETURN
previous
 



  • Hi PowerBIBunny,

    You are returning the previous quarter value, not the percentage change. That is why the measure keeps showing the home count instead of the change percentage. You should return the difference variable instead. Then format the measure as Percentage in Power BI.

    Percentage Change Homes =
    VAR PreviousHomes =
        CALCULATE(
            [number of homes],
            'Quarterly Data - ALL LA'[Quarter & Year] = "Q1 2026"
        )
    VAR CurrentHomes =
        CALCULATE(
            [number of homes],
            'Quarterly Data - ALL LA'[Quarter & Year] = "Q2 2026"
        )
    VAR Difference =
        DIVIDE(CurrentHomes - PreviousHomes, PreviousHomes)
    RETURN
        Difference

     

    πŸ’‘ Helpful? Give a Kudos πŸ‘ β€” keep the community growing
    βœ… Solved your issue? Mark as Solution βœ”οΈ β€” help others find it faster

    Best regards,
    Rupasree Achari | BI & Fabric Analytics Engineer 
  • I think the first issue is simple β€” in your measure you are calculating diff but in the end doing: return previous 

    So naturally it will always return home count for previous quarter, not percentage.

    Should be:

    RETURN difference

    Also one more thing, your "number of homes" measure is using Quality Data table but quarter filter is coming from Quarterly Data - ALL LA table.

    Just check if both tables are related properly. If relationship is missing / inactive, then Q1 and Q2 both may return same total.

     

    try this : 

    Percentage Change Homes =
    VAR previous =
    CALCULATE(
    [number of homes],
    'Quarterly Data - ALL LA'[Quarter & Year] = "Q1 2026"
    )

    VAR _current =
    CALCULATE(
    [number of homes],
    'Quarterly Data - ALL LA'[Quarter & Year] = "Q2 2026"
    )

    VAR difference =
    DIVIDE(_current - previous, previous)

    RETURN
    difference

     

    Helpful? Give a Kudos πŸ‘
    Solved? Mark as Solution βœ”οΈ
    β€” Azad Singh Thakur | Power BI Developer

5 Replies

  • Rupa01's avatar
    Rupa01
    Icon for Solution Sage rankSolution Sage

    Hi PowerBIBunny,

    You are returning the previous quarter value, not the percentage change. That is why the measure keeps showing the home count instead of the change percentage. You should return the difference variable instead. Then format the measure as Percentage in Power BI.

    Percentage Change Homes =
    VAR PreviousHomes =
        CALCULATE(
            [number of homes],
            'Quarterly Data - ALL LA'[Quarter & Year] = "Q1 2026"
        )
    VAR CurrentHomes =
        CALCULATE(
            [number of homes],
            'Quarterly Data - ALL LA'[Quarter & Year] = "Q2 2026"
        )
    VAR Difference =
        DIVIDE(CurrentHomes - PreviousHomes, PreviousHomes)
    RETURN
        Difference

     

    πŸ’‘ Helpful? Give a Kudos πŸ‘ β€” keep the community growing
    βœ… Solved your issue? Mark as Solution βœ”οΈ β€” help others find it faster

    Best regards,
    Rupasree Achari | BI & Fabric Analytics Engineer 
  • I think the first issue is simple β€” in your measure you are calculating diff but in the end doing: return previous 

    So naturally it will always return home count for previous quarter, not percentage.

    Should be:

    RETURN difference

    Also one more thing, your "number of homes" measure is using Quality Data table but quarter filter is coming from Quarterly Data - ALL LA table.

    Just check if both tables are related properly. If relationship is missing / inactive, then Q1 and Q2 both may return same total.

     

    try this : 

    Percentage Change Homes =
    VAR previous =
    CALCULATE(
    [number of homes],
    'Quarterly Data - ALL LA'[Quarter & Year] = "Q1 2026"
    )

    VAR _current =
    CALCULATE(
    [number of homes],
    'Quarterly Data - ALL LA'[Quarter & Year] = "Q2 2026"
    )

    VAR difference =
    DIVIDE(_current - previous, previous)

    RETURN
    difference

     

    Helpful? Give a Kudos πŸ‘
    Solved? Mark as Solution βœ”οΈ
    β€” Azad Singh Thakur | Power BI Developer
  • v-achippa's avatar
    v-achippa
    Icon for Community Support rankCommunity Support

    Hi PowerBIBunny,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you Rupa01 and Azadsingh for the prompt response.

     

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user's for the issue worked? or let us know if you need any further assistance.

     

    Thanks and regards,

    Anjan Kumar Chippa

    • v-achippa's avatar
      v-achippa
      Icon for Community Support rankCommunity Support

      Hi @PowerBIBunny,

       

      We wanted to kindly follow up to check if the solution provided by the user's for the issue worked? or let us know if you need any further assistance.

       

      Thanks and regards,

      Anjan Kumar Chippa

  • Hi PowerBIBunny ,

    you can rewrite your measure as follows:

    Percentage Change Homes =

     

    var previous = CALCULATE(
        [number of homes],
         filter('Quarterly Data - ALL LA','Quarterly Data - ALL LA'[Quarter & Year] = "Q1 2026"))

     

    var _current = CALCULATE(
        [number of homes],
        filter('Quarterly Data - ALL LA','Quarterly Data - ALL LA'[Quarter & Year]= "Q2 2026"))

     

    Var difference = (_current - previous)/previous
    RETURN
    difference

     

     

    if it still doesnt work could you please share if there is any slicer on your report and also the relationships between tables?

     

    If this post helps, then I would appreciate a thumbs up πŸ‘ and mark it as the solution βœ”️ to help the other members find it more quickly.