Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
mamichna
Regular Visitor

Measure that ignores the x-axis on a Line and Column Chart

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!

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @mamichna ,

 

We can use single relationship and create month column to meet your requirement.

 

1. Change the both direction to single direction.

 

Measure1.jpg

 

2. Then we can create a month column in Cost table.

 

Month = FORMAT(Cost[Date_completed],"mmmm")

Measure2.jpg

 

3. The result like this,

 

Measure3.jpg

 

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.

View solution in original post

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @mamichna ,

 

We can use single relationship and create month column to meet your requirement.

 

1. Change the both direction to single direction.

 

Measure1.jpg

 

2. Then we can create a month column in Cost table.

 

Month = FORMAT(Cost[Date_completed],"mmmm")

Measure2.jpg

 

3. The result like this,

 

Measure3.jpg

 

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.

amitchandak
Super User
Super User

@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!

 

https://www.dropbox.com/s/yt8n4jwfp4ifayw/Sample.pbix?dl=0 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.