Forum Discussion

Luggas's avatar
Luggas
Regular Visitor
10 months ago
Solved

Measure does not show same value in different Visuals

Dear Community,


I have an issue with my measure, that shows the percentage of the hours written by employees.


On the cards, there are 5 measures showing the proportional written hours by categorie volum1-volum5

 

On the right side, the chart should show the exact same measures in a cummulative way, using the sum of all 5 with this summarizing measure, since its not possible to place 5 measures or columns for the y-Axis:

 

Visual = [VISUAL_Volum5] + [VISUAL_Volum1] + [VISUAL_Volum2] + [VISUAL_Volum3] + [VISUAL_Volum4]
 
As one can see, there is a huge difference between the value hovered for volum1 = 52.53% and the one in the card being 4.98%, even tho its the same measure.
 
Has anyone experience something like that before?

 

 

 

  • Anonymous's avatar
    Anonymous
    9 months ago

    Hi Luggas,

     

    If the issue still persists, we kindly request you to share the sample data in a workable format such as text, an Excel file, or a PBIX file with sample data instead of screenshots. Additionally, please include the expected output. This will enable us to assist you more effectively.


    Regards,
    Prasanna Kumar

7 Replies

  • Hi Luggas 

    Reason: 

    • The card visual shows the total percentage for the entire dataset (overall context).
    • The bar chart visual calculates each category (Volum1–Volum5) in its own row context.

    That’s why, when you add up the five measures like this:

    Visual = [VISUAL_Volum1] + [VISUAL_Volum2] + [VISUAL_Volum3] + [VISUAL_Volum4] + [VISUAL_Volum5]

    It recalculates according to each context - so the total doesn’t match.

     

    Fix:
    If you want the same percentage across visuals, calculate each measure using the same denominator and same filter context (by using functions like CALCULATE, REMOVEFILTERS, or ALLSELECTED).Could you please try below steps:

    1. Sample data that I used to solve the problem:

    2. Create two measures: 

    Total % of Hours = 
    DIVIDE(
        SUM('Sample Data'[Hours]),
        CALCULATE(SUM('Sample Data'[Hours]), ALL('Sample Data'))
    )
    Visual (All Categories) = 
    CALCULATE(
        [Total % of Hours],
        KEEPFILTERS('Sample Data'[Category] IN {"Volum1","Volum2","Volum3","Volum4","Volum5"})
    )

    3. Output:

     

     

  • Luggas's avatar
    Luggas
    Regular Visitor

    Hi, I have to give you some more context about my data Modell

     

     

     

    My Source table looks almost like the one you shared rohit1991, thanks for that.

    In addition it has a cummulative YTD Capacity for each employee for each row of that column and anotherone with a proportional capacity per month per employee.



    Therefore I was able to write the following measure for each categorized hours written. E.g. that would be the Measure code for Visual_Volum1, that would be the same approach for the other Volumes. Here is some Code zenisekd :

    VISUAL_Volum1 = 
     
    VAR Prod_hours =
    
        CALCULATE(
            SUM(Table[hours]),
            F1_Final[Category] IN {
              "Volum1"   //Filter for Hours, that are categorized in Volum1 
             
            }
        )
    
    // Calculation of the entire Monthly capacity
    VAR DistributionCapacity = 
        SUMX(
            SUMMARIZE(
                Table,
                Table[PersNr], // Group by PersNr, to summarize the Capacity per employee		   
                Table [Month],
                "CapacityperMonth",
                CALCULATE(
                  
    		// Selects a distinct value of Monthly capacity per employee
                    FIRSTNONBLANK(Table [capa_per_month], 1) 
                )
            ),
            [CapacityperMonth]
        )
    
    
            // Divide the Prod_hours with the correct summarized Monthly capacity
    RETURN DIVIDE(Prod_hours, DistributionCapacity, 0)

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Luggas ,

     

    Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to rohit1991 and zenisekd  for prompt and helpful responses.

    Did you get a chance to try the solution shared by rohit1991 , The suggested approach directly addresses the issue. If you’re still facing any problems, please share more details about where it’s happening so we can help you better.

     

    Thanks & Regards,

    Prasanna Kumar

    • Luggas's avatar
      Luggas
      Regular Visitor

      Hi Anonymous,

      I adressed again my problem, since I did not present it so clearly in my initial Post.

      rohit1991 s approach would fit for another problem, and thank you again, for the quick response

       

      In my last post, I shared some more information about my dataset and the issue I was having with it. If you could have a look over it, I would mean a lot.

       

      Best Regards,

      Lucas

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Luggas,

     

    If the issue still persists, we kindly request you to share the sample data in a workable format such as text, an Excel file, or a PBIX file with sample data instead of screenshots. Additionally, please include the expected output. This will enable us to assist you more effectively.


    Regards,
    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Luggas,

     

    we kindly request you to share the sample data in a workable format such as text, an Excel file, or a PBIX file with sample data instead of screenshots. Additionally, please include the expected output. This will enable us to assist you more effectively.


    Regards,
    Prasanna Kumar