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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Ritaf
Responsive Resident
Responsive Resident

Table visualisation with percentage of row above

Hi,

I need to create the logic of the Funnel Chart on the table,
to show category, value an %, in a way that the first row is 100% and others are the percentage of the row above like on the picture I attached. is there is a way to make it happen dynamically?
Link to Pbix sample fiile 
table.JPG

 



1 ACCEPTED SOLUTION

Hi @Ritaf ,

I updated your sample pbix file(see attachment), please check whether that is what you want.

1. Create a calculated column as below to get the rank base on the sum of values group by category

Rank = 
RANKX (
    ALLSELECTED ( 'Sheet1'[Category] ),
    CALCULATE ( [test], ALLEXCEPT ( 'Sheet1', 'Sheet1'[Category] ) )
)

yingyinr_0-1643875729749.png

2. Create a measure as below to get the percentage

% = 
VAR _selcat =
    SELECTEDVALUE ( 'Sheet1'[Category] )
VAR _selindex =
    SELECTEDVALUE ( 'Sheet1'[Rank] )
VAR _prerank =
    CALCULATE (
        MAX ( 'Sheet1'[Rank] ),
        FILTER ( ALLSELECTED ( 'Sheet1' ), 'Sheet1'[Rank] < _selindex )
    )
VAR _pretest =
    SUMX ( FILTER ( ALLSELECTED ( 'Sheet1' ), 'Sheet1'[Rank] = _prerank ), [test] )
RETURN
    IF ( _selindex = 1, 1, DIVIDE ( [test], _pretest ) )

yingyinr_1-1643875832364.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.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Power BI has no concept of "Row Above" - you need to help it by providing indexes, or by hard coding the logic (for example "Sales as percentage of Calls".

 

 If you paste the sample data into a table in your post or use one of the file services it will be easier to work with. 

Ritaf
Responsive Resident
Responsive Resident

Hi, 
Thank you for your response I know that Power BI has no concept of "Row Above", not in visualization at less, and have no doubt that this isn't standard logic. 
There is a link for the sample file:https://drive.google.com/file/d/15dHsxNWd7Fh1Q-dhIaG9uh28r89cmFwr/view
I hope somebody has an idea how to solve it dynamically without measure for each category and "Switch" games.

Hi @Ritaf ,

I updated your sample pbix file(see attachment), please check whether that is what you want.

1. Create a calculated column as below to get the rank base on the sum of values group by category

Rank = 
RANKX (
    ALLSELECTED ( 'Sheet1'[Category] ),
    CALCULATE ( [test], ALLEXCEPT ( 'Sheet1', 'Sheet1'[Category] ) )
)

yingyinr_0-1643875729749.png

2. Create a measure as below to get the percentage

% = 
VAR _selcat =
    SELECTEDVALUE ( 'Sheet1'[Category] )
VAR _selindex =
    SELECTEDVALUE ( 'Sheet1'[Rank] )
VAR _prerank =
    CALCULATE (
        MAX ( 'Sheet1'[Rank] ),
        FILTER ( ALLSELECTED ( 'Sheet1' ), 'Sheet1'[Rank] < _selindex )
    )
VAR _pretest =
    SUMX ( FILTER ( ALLSELECTED ( 'Sheet1' ), 'Sheet1'[Rank] = _prerank ), [test] )
RETURN
    IF ( _selindex = 1, 1, DIVIDE ( [test], _pretest ) )

yingyinr_1-1643875832364.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.

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.