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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Avoid cummulative values on a line graph

Dear community,

I'm trying to figure out a line graph with of two different dimensions, for the same Category and period. I need two lines, instead of one, which is summing both.

I thought it might be from the sum tick within the Visuals section, which I can't disable it.

Any tip to solve this issue? graph1.JPGgraph2.JPGgraph3.JPGgraph4.JPGgraph5.JPG 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to place the column Label in the Legenda part of the line chart, that will give you the total for each of the labels ES and DE.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

8 REPLIES 8
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to place the column Label in the Legenda part of the line chart, that will give you the total for each of the labels ES and DE.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix ! Thanks for your help. In fact I tried that option today in the morning it and it worked. That's good that you have suggested the same approach, so it will be a solid solution. 

I would take this chance to ask you, if do you think it's possible also to add lines, along with the different "Labels" (Product), if we select more than one "Prazo" (Segment)?

 

Hi @Anonymous ,

 

Do you want to have more than one type of information? You want to have lines by lables and by and Prazo at the same time?

 

What is the exact result you need.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi again @MFelix ! Thanks for your interest.

Yes, indeed I need two dimension for daily prices [Cotacao]: Label (product) and Prazo (segment).

For instance, if I filter the information by [Label]: ES; and [Prazo]: Spot and Q4-2021, I would have 2 lines: ES/Spot and ES/Q4-2021.

Another situation could be, if I filter by [Label]: ES , FR; and [Prazo]: Spot and Q4-2021, I would have 4 lines: ES/Spot and ES/Q4-2021 + FR/Spot and FR/Q4-2021.

Is that possible or I will be restricted to one dimension?

Hi @Anonymous ,

 

Believe this can be achieve using a disconnected table with the options and a switch function.

 

This solution is based on a table of sales and using two different columns from different tables but you need to create a table that merges the two values from the columns you need in my case I did it by dax but you can also do it on the query editor.

DinamicAxis - RegionChannel = 
   FILTER( UNION(
        ADDCOLUMNS(SELECTCOLUMNS(SUMMARIZE(Geography, Geography[ContinentName]),"Region/Channel",Geography[ContinentName]),"Attribute", "Continent"),
        ADDCOLUMNS(SELECTCOLUMNS('Channel',"Region/Channel",Channel[ChannelName]),"Attribute", "Channel")
        ),
[Region/Channel] <> BLANK())

Table is the following:

MFelix_0-1622647344347.png

So basically I picked up the information for other two columns with much more information:

Continent:

MFelix_1-1622647396671.png

Channel

MFelix_2-1622647419789.png

 

Now you just need to create a measure with the following code:

Dinamic Axis Sales = 
SWITCH (
    SELECTEDVALUE ( 'DinamicAxis - RegionChannel'[Attribute] ),
    "Continent",
        SUMX (
            FILTER (
                SUMMARIZE (
                    sales,
                    Geography[ContinentName],
                    "TotalSales", SUM ( Sales[SalesAmount] )
                ),
                Geography[ContinentName]
                    = SELECTEDVALUE ( 'DinamicAxis - RegionChannel'[Region/Channel] )
            ),
            [TotalSales]
        ),
    "Channel",
        SUMX (
            FILTER (
                SUMMARIZE (
                    sales,
                    Channel[ChannelName],
                    "TotalSales", SUM ( Sales[SalesAmount] )
                ),
                Channel[ChannelName]
                    = SELECTEDVALUE ( 'DinamicAxis - RegionChannel'[Region/Channel] )
            ),
            [TotalSales]
        )
)

 

Now you can use the values on your table in the legend of the lines and on a slicer:

 

MFelix_3-1622649007076.png

 

Please check attach PBIX file.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix ! Thanks for your explanation.

I think is great idea for this workaround, the example that you gave! I tried to replicate it on my case, but I realized that insted of giving the aggregated Sales for a single atributte, like "online" or "north america", I would need a line like the sales of "North America" in "Online", "North America" in "Store", a line of "Europe" in "Online", "Europe" in "Store".

Is that possible to do it?

Thanks a lot.

Regards

Hi @Anonymous ,

 

In this case you can do one of two things:

 

1. Add a column to your original table with the following syntax:

Country / Continent = Geography[ContinentName] & "|" & Geography[RegionCountryName] 

 

Use this column on the legend of your line chart and the other two columns on the slicers.

 

2 Crate a table has the two columns in the same table and then change the measure to pick up those values the table will be something similar to:

Continent/Region = 
ADDCOLUMNS (
    SUMMARIZE ( Geography, Geography[RegionCountryName], Geography[ContinentName] ),
    "ID",Geography[ContinentName] & "|" & Geography[RegionCountryName] 
)

This table will look like this (table of unique conditions between country and continent):

MFelix_0-1622727996260.png

 

Now redo your measure to:

Dinamic Axis Sales_ = 
        SUMX (
            FILTER (
                SUMMARIZE (
                    sales,
                    Geography[RegionCountryName], Geography[ContinentName],
                    "TotalSales", SUM ( Sales[SalesAmount] )
                ),
                Geography[RegionCountryName]
                    = SELECTEDVALUE ( 'Continent/Region'[RegionCountryName] ) &&
                Geography[ContinentName]
                    = SELECTEDVALUE ( 'Continent/Region'[ContinentName] ) 
            ),
            [TotalSales]
        )

 

Use the ID column on your legend and the other two columns on the slicers:

 

MFelix_1-1622728123997.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi Miguel!

Sorry for the late feedback. I'm trying work on other developments, so I will stand-by this specific one. Nevertheless thanks for your patience and help. 

I will come back to solve this one soon.

Best regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors