Forum Discussion

ErikWarming's avatar
ErikWarming
Frequent Visitor
9 months ago
Solved

Same measure in the same table visual giving different result

The problem

I have a problem that I don’t know how to diagnose or solve any more.

My client has two measures and want to see the difference between the two. A simple diff = [measure1] – [measure2], but what we saw was that [measure1] was treated as empty and the result was – [measure2].

I investigated and found that a calculation group, created in Tabular Editor 2.19.0 had a formatting on one of its calculations and that caused each other measure to have a hidden version of itself. A ghost measure.

 

 

 

I removed for formatting of the calculation group and now there are no ghost measures any more. But the problem persists. So it was not a case of powerbi arbetarely picking one of the identically measures and then returning a empty value. 

The setup

  • Data is in a T-SQL onprem database
  • Tabular editor 2.19.0 deploys the model to analysis services
    • the compatibility level is 1500
    • culture: da-DK - Danish (denmark)
    • default mode: import
    • default powerbi data source version: powerBI_v1
  • One powerbi report connect to the analysis services and is saved as a semantic model
    • Multiple other reports/Apps connect to this semantic model

This setup is in production and have been for a some years

The real codes

Realiseret = sum(PostingFinanceGroup[Amount])
Budget Gruppe = sum(BudgetFinanceGroup[Amount])

 

Budget Gruppe YTD = CALCULATE ([Budget Gruppe],DATESYTD ( 'Date'[Date] ))
Realiseret YTD = CALCULATE ([Realiseret],DATESYTD ( 'Date'[Date] ))

 

diff1 = [Realiseret YTD] - [Budget Gruppe YTD]
diff2 = [Realiseret YTD] - [Budget Gruppe YTD]
diff3 = [Realiseret YTD] - [Budget Gruppe YTD]
diff4 = [Realiseret YTD] - [Budget Gruppe YTD]

 

And here is the result. Diff 1-3 calculates correctly, while diff4 returns only - [Budget Gruppe YTD]

There is a page level filter on year = 2025 and there is a visual level filter on OmsGruppe just to show 2 rows, and not all of them, but that is just to simplify the screenshot. The error is the same through all OmsGruppe's.

 

Is it in the semantic model?

I had the same problem if I connected to the semantic model or directly to the analysis services.

 

Was there other ghost measures?

I tried being explicid in my measures that that did not make a difference. 

Diff1 ='PostingFinanceGroup'[Realiseret YTD] - 'BudgetFinanceGroup'[Budget Gruppe YTD]

When I search there are no other hidden measures with the name

 

Is it the calculation group that is still causing trouble?

For the calculation group 'Time Intelligence' I tried to disable that by either using its default that is just a SELECTEDMEASURE() and by making a Diff_NoCalc measure, but 4 copies of that had the same result

Diff_NoCalc1 =
VAR r =
    CALCULATE(
        [Realiseret YTD],
        REMOVEFILTERS ( 'Time Intelligence') 
    )
VAR b =
    CALCULATE(
        [Budget Gruppe YTD],
        REMOVEFILTERS ( 'Time Intelligence')
    )
RETURN
    r - b

 

Update: I have also tried to delete the calculation group all together from the model and deployed it under a new name to the analysis services. This did not make a difference

A strange behavior

The Diff_NoCalc experiment did show the same problem with the Diff_NoCalc4. So I experimented in a new visual.

In my table visual i have OmsGruppe, Realiseret TYD, Budget Gruppe YTD, diff1, diff2, diff3, diff4 and its the 6th column where I have the problem. Same thing happened if I had OmsGruppe, Realiseret TYD, Budget Gruppe YTD, diff4, diff3, diff2, diff1 it was still the 6th column that had the problem. 

 

Afterwards if I move the measures around in the visual, the 6th placed column is still the one with the errror, even if it was moved to the 4th place

 

What now?

I'm out of ideas, so now I ask the fantastic powerbi community

  • Anonymous's avatar
    Anonymous
    8 months ago

    Hi ErikWarming ,

     

    Based on my understanding and further testing, this issue can be fully reproduced in a minimal PBIX where multiple identical measures are added to the same table visual and one of them consistently returns an incorrect result based on column position. The same measures evaluate correctly in cards, matrices, and separate visuals, confirming that the DAX logic and data model are not at fault.

     

    This strongly indicates a table visual evaluation/caching issue in the Power BI/Fabric engine. As a verified workaround, using a single measure with variables, a calculation group, or a disconnected helper table consistently resolves the problem. I’ve attached a simplified PBIX demonstrating both the issue and the workaround. Given the deterministic repro and resolution, this should be treated as a product bug rather than a modeling or DAX issue.

    Thank you,

    Tejaswi.

     

13 Replies

  • ErikWarming Hey,

    • Dynamic format strings/calculation groups left “ghost” formatting on measures in the model. This can corrupt measure bindings in visuals (seen as the 6th column consistently mis-evaluating).
    • It’s a model/engine bug seen with calc groups + dynamic formatting on SSAS 1500; persists even after you delete the calc group unless you clear the format string definitions and redeploy.

    Quick diagnostics

    • In DAX Studio, run a direct query against the model (not Power BI visual):


    EVALUATE
    SUMMARIZECOLUMNS(
    'Date'[Year], 'Dim'[OmsGruppe],
    "RealiseretYTD",[Realiseret YTD],
    "BudgetYTD",[Budget Gruppe YTD],
    "Diff",[Realiseret YTD] - [Budget Gruppe YTD]
    )
    If the numbers are correct here, it’s a Desktop visual bug; if wrong, it’s the model.

    • Check measures in Tabular Editor: select all measures → ensure FormatStringDefinition is null (no expression). If any show an Fx icon, clear it.
    • Inspect the table visual: remove all conditional formatting (icons/data bars), tooltips, and totals; test again. The 6th column symptom often stems from conditional formatting referencing SELECTEDMEASURE.

    Fixes/workarounds

    • Hard reset dynamic formatting:


    - In Tabular Editor: for m in Model.AllMeasures → m.FormatStringDefinition = null; m.FormatString = "General" (or appropriate); save, deploy, process.
    - Delete the old calc group, save, then restart SSAS (or recycle) and reprocess the database to clear cached metadata.

    • Recreate base measures (new GUIDs):


    - Create [Realiseret YTD v2] and [Budget Gruppe YTD v2] with identical logic.
    - Create Diff using VARs:
    Diff =
    VAR r = COALESCE([Realiseret YTD v2], 0)
    VAR b = COALESCE([Budget Gruppe YTD v2], 0)
    RETURN r - b
    Replace the old measures in the visual.

    • If the “6th column” still misbehaves only in Desktop:


    - Update Power BI Desktop to latest; test on a different machine.
    - Use two table visuals (split columns 1–5 and 6+), or use a field parameter to show one Diff measure multiple times with different display names (avoids multiple distinct measures).

    • Ensure no calc groups affect the visual:


    - Remove all filters from calc group tables (visual, page, report), and confirm precedence is default.
    - If you keep calc groups, avoid dynamic format strings; use static formats.

    Environment

    • Apply latest SSAS/Power BI engine updates (SSAS 2019 CU / Azure AS equivalent). Known issues with calc groups + dynamic formatting were fixed in later CUs.
    • Clear caches: restart SSAS service; in DAX Studio: Clear Cache; in Desktop: File > Options > Data Load > Clear cache.

    If DAX Studio outputs correct values while Desktop still shows the 6th column issue, it’s a visual/rendering bug—log it via Help > Feedback and use the split-visual/field-parameter workaround.

     


    Thanks

    Haish K 

    If I resolve your issue. Kindly give kudos to this post and accept it as a solution so other can refer this.

    • ErikWarming's avatar
      ErikWarming
      Frequent Visitor

      Thank you HarishKM , this was actionable and some good tests. Unfortunatly it was not a solution 😥

       

      I tested in DaxStudio and the error did not appear = This is not a model problem, its a powerbi desktop problem 😃. I can tell my client that this only affects custom measures, not the ones in the model.

      I tried clearing the cash as suggested with no luck.

       

      I ran a scrip on the model, and clearned all the formatting from the model > Error persisted

       

      I tried making brand new versions of the measures ([Budget Gruppe YTD],[Realiseret YTD]) and their source measures and made 5diff measures of those. No error, so I was starting to think I had to redo every measure in the model. I made a script that made a copy of each measure, and the old measure got the prefix of "old_", like [old_Realiseret YTD]. (there are 234 measures in this model)

      At first glance, there were no errors, and the reports that was build on the model, all still worked as intented. Happy and ready to tell my client, I deletede all the extra 234 measures with the "old_" prefix to clean up

      Then the error returned

       

      Updating SSAS2019 is not an option, so I'm stuck at compatibility 1500.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi ErikWarming ,

        Thank you for detailing your testing process; your insights are very valuable. Based on your results, it seems this issue is specific to Power BI Desktop rather than the data model or DAX logic, as the measures function as expected in DAX Studio.

        Duplicating the measures offers only a temporary solution, since the error returns when the original measures are deleted. While newly created measures work properly, the issue recurs after removing the old ones, suggesting a limitation within Power BI Desktop or SSAS 2019 (compatibility level 1500) regarding custom measures.

        Given the current compatibility requirements and the inability to upgrade SSAS at this time, this seems to be a Power BI Desktop limitation that may need escalation or further testing in the latest version. For now, the recommended approach is to keep the original measures unused and proceed with the new ones.

        Thank you.

    • ErikWarming's avatar
      ErikWarming
      Frequent Visitor

      You assume correctly. Since its a preview features and this is an old established model, I didn't even think to mention it.

      To my knowledge there are no preview features in this model

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ErikWarming ,

    Thanks for reaching out to the Microsoft fabric community forum.

     

    The issue outlined in the Fabric community thread arises when multiple measures with identical DAX formulas, such as [Realiseret YTD] - [Budget Gruppe YTD], display inconsistent results within the same table visual. Notably, one measure may show only -[Budget Gruppe YTD], while others calculate as expected. This inconsistency is linked to the column position in the visual, rather than the measure definition, indicating a rendering or evaluation anomaly within the engine instead of a DAX logic error. The original poster attempted several solutions, including removing calculation groups, disabling time-intelligence formatting, and explicitly qualifying base measures, but these did not resolve the issue.

     

    While dynamic format strings in calculation groups were suggested as a possible cause, their removal did not fix the problem. As a result, the underlying issue likely relates to how the engine evaluates measures based on column order. Suggested workarounds include rebuilding the visual, placing measures in a separate table, renaming measures, or using unique variable-based calculations. However, a confirmed solution has not been identified, and escalation to Microsoft support may be necessary for full resolution.

    Best Regards,
    Tejaswi.
    Community Support

    • ErikWarming's avatar
      ErikWarming
      Frequent Visitor

      Hello Anonymous 

      I have to ask, what was your goal with this AI generated summary?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi ErikWarming ,

         

        I tested the same measures in a clean model and they are giving correct and consistent results, so the DAX logic looks fine. Since this issue is not happening outside your setup, it looks like something specific to your model or environment.

         

        If possible, sharing a simplified PBIX and Screenshort  would help understand what in the model is causing this behaviour.

         



        Best Regards,
        Tejaswi.
        Community Support


  • As others have said, this indeed appears to be some issue with Power BI Desktop's visual query generation.

    Could you try to capture and share the DAX generated for the visual (using the "Performance Analyzer" view in Power BI Desktop)? Perhaps the query itself reveals what is going on. If nothing obvious stands out in the query, please also try to run that same query in DAX Studio and let us know the results.