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.
Hi,
I struggle to create a visualization that updates an average value to weeks based on a Dynamic Measure.
I'm creating a dashboard to keep track of %usage of each person in a team. Each set of data (row) contains, [Hours], [Person], [EndOfWeek], [Week Number]. [Project], [ProjectType] that are in my table 'JobTime'
Doing this, I calculate total number of 'Hours' per Person, Per Week (37.5h). Visualizing this, I want to choose week numbers, and get a percentage on %utilization of a person based on the week interval I have chosen.
1. I created a Measure: [WeekIntervals] = Distinctcount(JobTime[Week Number]) to count no. of weeks.
2. I make a slicer to adjust the week interval and a Power BI Card that updates [WeekIntervals] based on what I slice.
3. I calculate no. of hours per person per week as a percentage by JobTime[Hours]/37.5/[WeekIntervals].
[WeekIntervals] is dynamic when looking at the Power BI Card, but not in data when I've put the Measure into the DAX Formula.
Is there any way to make a Dynamic Measure to work in a DAX formula when visualizing data? See figure below.
Thanks
Hi,
I'm creating a dashboard to keep track of %usage of each person in a team. Each set of data (row) contains, [Hours], [Person], [EndOfWeek], [Week Number]. [Project], [ProjectType] that are in my table 'JobTime'. 37.5 hours are the hours billed per person per week. I made a measure called [WeekInterval] that is the number of distinct weeks in [Week Number].
Bar plot below are hours per person, per week. The Values are calculated as [Hours]/37.5/[WeekInterval]. I want the bar plot values to update as I change the the slicer to account for different week intervals. Currently, this doesnt work, as it in the formula will just act as a static value even when I adjust my slicer.
Is there any way a Measure can change Values dynamically as a variable?
Thanks,
Shun
Did you try SELECTEDVALUE in your measure? This DAX can capture the value user selected in the report
Hi Jessica,
Thanks for your response.
I tried to make a separate column that calculates a uniform value of distinctcount([Week Number]). But this uniform value in the column doesnt change by filtering.
So if I use SELECTEDVALUE, it would be selevcting a constant value of 9, instead of a dynamic value.
Was this what you meant?
Hi @Anonymous,
Please try this:
[WeekIntervals] =
CALCULATE ( DISTINCTCOUNT ( JobTime[Week Number] ), ALLSELECTED ( JobTime ) )
For more advice, please share some dummy data so that I can reproduce your scenario on my side.
Regards,
Yuliana Gu
Hi @v-yulgu-msft,
Thanks for your response. I tried using formulas below to generate the plot.
Week Interval = calculate(distinctcount(JobTime[Week Number]),ALLSELECTED(JobTime))
Values = HoursPercentage = JobTime[Hours]/37.5/[Week Interval]
But it still doesnt update when I filter my list using Slicer. In the example below, I should get 84% on the person on top row, but I'm getting 18%. It's dividing by the total number of weeks in the list rather than the sliced number of weeks. Data and an example where slicer filters to 2 weeeks. It divides by [Week Interval]=9 instead of 2
number of week numbers that are filtered.
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 |
---|---|
114 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |