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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
lroque1991
New Member

How do I put Totals on my graph?

Hello everybody! I am newbie to power bi and I am encountering some challenges.

One challenge I'm not able to solve is the one below:
How to insert the total average in the graph.
Noting that the chart contains Date and Values.

 

This is what i want:

what i want.png

 

This is what i have:

Indicadores2.pngIndicadores1.pngdata.pngentrega as 15h.png

 

If anyone can help me i would be very grateful 🙂

 

 

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

Hi @lroque1991 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Assume that you have the data as below table

yingyinr_1-1676532743626.png

2. Create a dimension table

yingyinr_2-1676532770399.png

3. Create a measure as below

Measure = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _pervalue =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', FORMAT ( 'Table'[Date], "m/d/yyyy" ) = _seldate )
    )
VAR _totala =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Type] = SELECTEDVALUE ( 'Table'[Type] )
        )
    )
RETURN
    IF ( _seldate = "Total", _totala, _pervalue )

yingyinr_0-1676532668654.png

If the above ones still not help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples.It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi  @lroque1991 ,

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lroque1991
New Member

Hello @v-yiruan-msft,

 

Thank you very much for trying to help me.

Unfortunately I couldn't make it work. As I'm a newbie, I don't know where I went wrong and I find it easier to share my pbix.

Again, thank you very much for your time in trying to help me. If you manage to add the "Total" in some graph it will already serve as an example so that I can do it on my own. 

 

https://1drv.ms/u/s!AlxywfCb-dR8ga5hGeXPGLf1LIaRoQ

 

Thanks! 🙂

Hi @lroque1991 ,

I updated your sample pbix file(see the attachment), please check if that is what you want. I tried another easier method in it.

1. Create a calculated column as below in the table 'Metas e Indicadores'

Total = "Total"

2. Create a measure as below to get the total value

MTotal = 
IF (
    SELECTEDVALUE ( 'Metas e Indicadores'[Total] ) = "Total",
    CALCULATE (
        SUM ( 'Metas e Indicadores'[Meta Entrega às 15h] ),
        ALLSELECTED ( 'Metas e Indicadores' )
    )
)

3. Create a column chart as below screenshot

yingyinr_0-1676603104968.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yiruan-msft
Community Support
Community Support

Hi @lroque1991 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Assume that you have the data as below table

yingyinr_1-1676532743626.png

2. Create a dimension table

yingyinr_2-1676532770399.png

3. Create a measure as below

Measure = 
VAR _seldate =
    SELECTEDVALUE ( 'Date'[Date] )
VAR _pervalue =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', FORMAT ( 'Table'[Date], "m/d/yyyy" ) = _seldate )
    )
VAR _totala =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Type] = SELECTEDVALUE ( 'Table'[Type] )
        )
    )
RETURN
    IF ( _seldate = "Total", _totala, _pervalue )

yingyinr_0-1676532668654.png

If the above ones still not help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples.It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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