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.
I'd like to display a measure of cost per total item count per month as the line on a line and column chart. The columns of my chart are the sum of all the costs per month, and I would like the line of my chart to be the measure.
I'm having trouble with the denominator of the measure (total item count). I'd like the denominator to include a number (that can be filtered using a slicer) of the whole item count versus the count of only items with cost during the month. The number I want displays on a card, but filters into the specific month when added to the chart.
Example:
January: Total Cost = $1000 Count of Items with Cost (monthly) = 50 Total Items in the Population (sliced by type) = 1000
February: Total Cost = $2000 Count of Items with Cost (monthly) = 70 Total Items in the Population (sliced by type) = 1000
The Result I'm getting:
January: $1000 (Total Cost) / 50 (Total Items with Cost in the month) = $20.00
February: $2000 (Total Cost) / 70 (Total Items with Cost in the month) = $28.57
The Result I want:
January: $1000 (Total Cost) / 1000 (Total Items in the population) = $1.00
February: $2000 (Total Cost) / 1000 (Total Items in the population) = $2.00
Is there a way to filter the item count as the sliced number that counts the total items while ignoring the monthly filter (x-axis) of the chart? I've tried writing the measure with the ALL DAX code and ALLEXCEPT(items, slicer column), but the item count is still filtered by date on the chart. I appreciate any help!
Solved! Go to Solution.
Hi @mamichna ,
We can use single relationship and create month column to meet your requirement.
1. Change the both direction to single direction.
2. Then we can create a month column in Cost table.
Month = FORMAT(Cost[Date_completed],"mmmm")
3. The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mamichna ,
We can use single relationship and create month column to meet your requirement.
1. Change the both direction to single direction.
2. Then we can create a month column in Cost table.
Month = FORMAT(Cost[Date_completed],"mmmm")
3. The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@mamichna , Can you share sample data and sample output in a table format? Or a sample pbix after removing sensitive data.
All should have worked
Like
calculate(count(Item[item]),all(Item]))
It would be better move item to a different table and join with item in your table so that impact of all is there on that table
@amitchandak, I included a link to a sample pbix that shows the issue and measure below. Thank you for helping!
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 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |