Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello All,
I'm relatively new to Power BI and have a question about the correct approach to getting a desired value.
Below is a screenshot of some data I loaded to a stacked bar chart. I'd like to create a card that reflects the average monthly delta between the two separate groups in the chart. I can't figure out how to do this with calculated columns and/or measures.
The basic math is shown below, I just don't know how to do it in DAX / Power BI.
Any help would be appreciated!
You may refer to measure below.
Measure = AVERAGEX ( Table1, Table1[Group 1] - Table1[Group 2] )
@v-chuncz-msft Thank you for the quick response.
I followed your instructions, and added count( in front of each group as these are columns with date values and just looking for count. Unfortunately I'm not getting the correct values in the math and am not clear as to why.
The below formula should return 2 since 6-1 = 5, 2-3 = -1 and the average of 5 & -1 = 2.
LoadingBalance = AVERAGEX( Projects, COUNT(Projects[Group1]) - COUNT(Projects[Group2]) )
But as you can see from the card that I overlayed on the graph it is returning 0. Not clear as to why. Any help would be appreciated.
You may check link below.
http://community.powerbi.com/t5/Desktop/Change-table-visualization-total/m-p/323290#M144103
@v-chuncz-msft & @nickchobotar,
Thank you both for your help on this. I've got some other visualizations that have taken priority at the moment so will have to get back to tackling this once those are complete. I will look at both of your responses to see what I can come up with. @nickchobotar I did try to create a quick excel file to reflect the issues I'm having but couldn't quite get there. Seems as though I need to troubleshoot my file a bit more.
Regards,
Eric
With the COUNT() you are taking an averarge of 0 by saying give me 2 - 2. Just skip the COUNT.
AVERAGEX( Projects, Projects[Group1] - Projects[Group2] )
N -
@nickchobotar thanks for the input.
When I don't include the COUNT function I get a returned value in the hundreds (which is why I assumed it was adding the dates vs. a count of them). Thoughts?
Unfortunately I'm pulling from my companies SQL servers and all the data is confidential. I'll see if I can build a quick sample version with excel to see if it does the same thing though.
Regards,
Eric
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |