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
alihijazi
Helper I
Helper I

Help with charts

Hello I'm new to Power BI

I want to create a bar chart by month and display for each month the ratio of sales per month to total sales

Please advise

1 ACCEPTED SOLUTION
austinsense
Impactful Individual
Impactful Individual

This can totally be done.

 

First, you'll need a measure to calculate the ratio - I'll break it down into three measures. I'm not sure what your data looks like so I'm going to assume that you have one big table of data that has all of your sales listed by date.

 

[Sales] = SUM( Sales[Amount] )

[Total Sales] = CALCULATE( [Sales], ALL( Sales[Date] ) )

[Ratio - Sales to Total Sales] = DIVIDE( [Sales], [Total Sales] )

Second, You'll drag the [Ratio - Sales to Total Sales] onto the dashboard area in Power BI, select bar chart, put the months in the Axis section and you should be good to go.

 

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

View solution in original post

3 REPLIES 3
austinsense
Impactful Individual
Impactful Individual

This can totally be done.

 

First, you'll need a measure to calculate the ratio - I'll break it down into three measures. I'm not sure what your data looks like so I'm going to assume that you have one big table of data that has all of your sales listed by date.

 

[Sales] = SUM( Sales[Amount] )

[Total Sales] = CALCULATE( [Sales], ALL( Sales[Date] ) )

[Ratio - Sales to Total Sales] = DIVIDE( [Sales], [Total Sales] )

Second, You'll drag the [Ratio - Sales to Total Sales] onto the dashboard area in Power BI, select bar chart, put the months in the Axis section and you should be good to go.

 

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

thank you for your prompt reply

Actually I'm expert in QlikView set analysis

and it seems that DAX is similar to that

 

so here to ignore dimension in a chart we use All([the dimension to ignore])?

is this true?

That's exactly right ...

 

  1. CALCULATE() to instruct the measure that you're going to alter the filter - meaning the report will filter the month but you want to ignore that filter.
  2. Just like you said, ALL() to instruct the measure which dimension to ignore.

You may need to instruct the measure to ignore the month dimension instead of the date dimension.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

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.