Forum Discussion
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:
- Anonymous10 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
- rohit1991Super User
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:
- zenisekdSuper User
Could you share your dax code with us? My money is on that.
- LuggasRegular 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) - AnonymousNot 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
- LuggasRegular 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
- AnonymousNot 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 - AnonymousNot 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