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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vjnvinod
Impactful Individual
Impactful Individual

Tricky Power BI question

Dear Community,

 

Below is my table in the Page 1 of power BI sofware

 

SLTP
AD311628
AS137153
CB-65774
TA117019
Tx152892
Total652918

 

I need 2 solutions

 

1) an additonal measure which calculates my Running %, see my output table below which i want to achieve(below i did manually in excel)

 

Required Output in %
48%
21%
-10%
18%
23%
100%

 

2) Automated text which changes dynamically based on the value 

"Ad constitute 48% of total pipeline value, followed by Tx 23%"

 

Let me know how to achieve this

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

I think the issue was with scenario where there is only 1 entry meeting the criteria, try this code

Measure = 
VAR _Summary = ADDCOLUMNS(VALUES('Table'[SL]),"Value",[TP_SUM],"%",[Running %])
VAR _Top2 = TOPN(2,_Summary,[%],DESC)
VAR _FirstValue = MAXX(_Top2,[%])
VAR _FirstName = FILTER(_Top2,[%]=_FirstValue) 
VAR _SecondValue = MINX(_Top2,[%])
VAR _SecondName = FILTER(_Top2,[%]=_SecondValue)
RETURN
CONCATENATEX(_FirstName,[SL]) & " constitute " & FORMAT(_FirstValue, "Percent") & " of total pipeline value, followed by " & CONCATENATEX(_SecondName,[SL]) & " " & FORMAT(_SecondValue, "Percent")


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

11 REPLIES 11

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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