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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
CC__123
Frequent Visitor

How to create a chart that shows a decrease over time without a date variable

Hi all,

 

I'm new to Power BI and I can't figure out how to create a chart (preferably an area or line chart) which shows the decrease in number of participants (in %) over a period of time, without using a date-type variable.

 

Ex1.png

1= active, 0 = not active

 

For example, I'm trying to create a chart which will show that in period 1 all participants are active (100%) but in period 2 only 83% of the participants remained active and in period 3 there's 67% left.  

 

I've seen these charts before but the X-axis is always a date-related variable, while in this instance the period-variable is unrelated to a specified date.

 

I hope someone can help me!

1 ACCEPTED SOLUTION
ChrisMendoza
Resident Rockstar
Resident Rockstar

@CC__123 -

Unpivot your table using Power Query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCkgtKs7PUzBU0lHCxLE6cAVGWBQYICswRpGAYSQFJoRMMCXkBjMM48EmxAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Person = _t, #"Period 1" = _t, #"Period 2" = _t, #"Period 3" = _t, #"Period 4" = _t, #"Period 5" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Person", type text}, {"Period 1", Int64.Type}, {"Period 2", Int64.Type}, {"Period 3", Int64.Type}, {"Period 4", Int64.Type}, {"Period 5", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Person"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

then write a measure as:

Measure = DIVIDE(CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Attribute])),COUNTROWS('Table'))

format as 'Percentage' > should return as:

cc_123.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
ChrisMendoza
Resident Rockstar
Resident Rockstar

@CC__123 -

Unpivot your table using Power Query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCkgtKs7PUzBU0lHCxLE6cAVGWBQYICswRpGAYSQFJoRMMCXkBjMM48EmxAIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Person = _t, #"Period 1" = _t, #"Period 2" = _t, #"Period 3" = _t, #"Period 4" = _t, #"Period 5" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Person", type text}, {"Period 1", Int64.Type}, {"Period 2", Int64.Type}, {"Period 3", Int64.Type}, {"Period 4", Int64.Type}, {"Period 5", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Person"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

then write a measure as:

Measure = DIVIDE(CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Attribute])),COUNTROWS('Table'))

format as 'Percentage' > should return as:

cc_123.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



analyticsnags
Regular Visitor

I hope Power Bi by default order by X axis based on measure you use.

 

So any bar chart / column chart you can acieve it by default. If it is not working try to change the  sort property by clicking the three dots on top of chart.

Sort.JPG

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.