Forum Discussion

David-CF's avatar
David-CF
Regular Visitor
6 years ago

Newbi needs help with simple bar graph

Hi All

Apologies if this is a double up - I tried to post it 3 times now before but it keeps crashing.

I have a data set like this:

NameTotal DueDecNovOctPre-Oct
Customer 1$1,019.68$0.00$1,019.68$0.00$0.00
Customer 2$667.00$0.00$0.00$166.75$500.25
Customer 3$1,347.02$17.02$17.02$0.00$1,312.98
Customer 4$0.01$0.00$0.00$0.00$0.01
Customer 5$1,079.02$752.11$0.00$156.70$170.21
Customer 6$207.00$207.00$0.00$0.00$0.00
Customer 7$188.03$188.03$0.00$0.00$0.00
Customer 8$186.30$93.15$93.15$0.00$0.00
Customer 9$125.35$0.00$0.00$0.00

$125.35

 

I want to create a bar graph that shows the total value for each column and then have the tool tip display the top N customers in each time period (pre-oct, oct, etc).

 

I'm brand new to all this so any help appreciated.

 

Happy New Year

David

4 Replies

  • Hi David-CF 

     

    Per your screenshot, if this is your raw data, do following transformation and create a bar graph.

     

    1.  go to Edit Query - Select Customer Name Column - Use Unpivot other columns from Transform tab - Unpivot Columns

        

     

    2. use Rename Attribute column if you want to

    3. Close and Apply the power Query window

    4. Add Bar graph visual on your report page. - attribute/renamed col in axis value column in values

    5. create a tooltip page as instructed on below link.

    https://docs.microsoft.com/en-us/power-bi/desktop-tooltips

     

    this should get you what you trying to achieve, let me know in case of any questions.

     

    Thank You,

    Washivale

    • David-CF's avatar
      David-CF
      Regular Visitor

      Thank you for your help - I'll give it a try.

  • v-juanli-msft's avatar
    v-juanli-msft
    Icon for Community Support rankCommunity Support

    Hi David-CF 

    As tested, i can get this result finally, please download my pbix for more details.

    1.create what-if parameter

    2.Create measures

    Measure =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[year] = MAX ( 'Table'[year] )
                && 'Table'[month] = MAX ( 'Table'[month] )
                && 'Table'[Name] = MAX ( 'Table'[Name] )
        )
    )
    
    Measure 2 = RANKX(ALLSELECTED('Table'),[Measure],,DESC,Dense)
    
    Measure 3 = IF([Measure 2]<=[top n Parameter Value],[Measure])
    

     

    3. Create a tooltip page

    4. Create tooltips based on report pages in Power BI Desktop

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    • David-CF's avatar
      David-CF
      Regular Visitor

      Thank you for your help - I'll give it a try.