SOLVED

Creating Chart from multiple Pivot tables

Brass Contributor

I have a set of data as uploaded.

 I need to have distinct count from suppliers within a specific period.

The details are mentioned in the excel data itself. Can someone please help me?

 

Thanks in advance.

5 Replies

@Ubaid ur Rahman 

That's better to do with DAX. First, create Date table in your model (to simplify could be done within Power Pivot clicking on New Date table) and link it one-to-many with your Range table.

Next add two measures

Vendor Distinct Count :=
DISTINCTCOUNT ( Range[Vendor] )

and

Running Year Distinct Count:=CALCULATE (
    [Vendor Distinct Count],
    DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -1, YEAR )
)

and build Pivot Table from data model using measures, connect existing slicers to that Pivot Table.

Result is as

image.png

It like this

image.png

but very depends on which kind of chart you'd like to have.

@Sergei Baklan Dear Sergei,

 

Thank you very much for your answer.

 

Actually I need to compare yearly increase or decrease of our suppliers in database. Like for month Dec 18 I will take the values of Jan 2018-Dec 2018. (sorry by mistake I mentioned wrong date).

Is it possible to make such buckets of the following...

 

Dec 19Jan 18 - Dec 19
Jan 19Feb 18 - Jan 19
Feb 19Mrz 18 - Feb 19
Mrz 19April 18 - Mrz 19
Apr 19May 18 - April 19
Mai 19June 18 - May 19
Jun 19July 18 - June 19
Jul 19Aug 18 - July 19
Aug 19Sep 18 - Aug 19

 

then I want to simply show in bar chart where we can easily see the number decreased or increased.

It would be great if I can do the same on quarterly basis.

Thank you

 

@Sergei Baklan Hi,

 

I think I got it. I just selected the months I wanted and it gives me th result.

Now how can i do this for quarterly basis?

Secondly, is there any way to show the Grand total in Bar chart? i am not able to do it.

See the file.

 

Thank you

 

@Ubaid ur Rahman 

Hi,

You may add more calculated columns to Dates table in data model.

For Periods

=FORMAT(DATEADD('Calendar'[Date],-1,YEAR),"MMM YY") &
  " - " & FORMAT([Date],"MMM YY")

For Quarters

=ROUNDUP(MONTH('Calendar'[Date])/3,0) & "Q" & FORMAT('Calendar'[Date],"YY")

Add Pivot Table and Pivot Chart using quarters and aggregating Vendor Distinct Count measure.

All together is as

image.png

Please check in attached

best response confirmed by Ubaid ur Rahman (Brass Contributor)
Solution

@Ubaid ur Rahman 

I didn't sort months/periods in previous variant, corrected in attached.

1 best response

Accepted Solutions
best response confirmed by Ubaid ur Rahman (Brass Contributor)
Solution

@Ubaid ur Rahman 

I didn't sort months/periods in previous variant, corrected in attached.

View solution in original post