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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Falaerm
Frequent Visitor

Show the Value from a Cell: using Dynamic Index || Count Dax Formula?

Hello All,

 

I have a table of power market which contains a column of Daily Return called "LN" (Sort Descending).

I have written a measure which has given me the specific number of the row containing the value I need to know on column LN. This number can change because of the period chosen.

 

 

 

 

Scenario VAR = ROUNDUP((0.95)*COUNT('GFI German Base power M1'[LN]),0)​

 

 

 

 

 

Falaerm_1-1692658643261.pngFalaerm_0-1692658594414.png

 

Here for instance I want from the Report View find the row 86 of the Column LN.

Falaerm_2-1692658905545.png

I tried to create a system of Index but some number of the order is missing when I move the slicer of the period from the report view.

 

I tried these formulas but no luck .

 

 

 

 

Ln order = RANKX( ALL('GFI German Base power M1'), 'GFI German Base power M1'[LN], , ASC, Dense)
IndexColumn = COUNTX(FILTER('GFI German Base power M1', 'GFI German Base power M1'[LN] <= EARLIER('GFI German Base power M1'[LN])), 'GFI German Base power M1'[LN])

 

 

 

 

Can any one please suggest me with a solution.

 

Best, 

 

Romain.A

1 ACCEPTED SOLUTION

I already tried the formulas that you proposed and it didn't worked. I finally find out a solution by my own. 

 

VAR_95 = CALCULATE(SUM('GFI German Base power M1'[LN]),TOPN(([Scenario VAR]),'GFI German Base power M1',[LN], ASC))-CALCULATE(SUM('GFI German Base power M1'[LN]),TOPN(([Scenario VAR]-1),'GFI German Base power M1',[LN], ASC))

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Falaerm , have you check if new rownumber or rank function can help

New DAX Function: Rownumber- https://www.youtube.com/watch?v=yS9-IQjUDwg&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=1

 

Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo

 

or window

 

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I already tried the formulas that you proposed and it didn't worked. I finally find out a solution by my own. 

 

VAR_95 = CALCULATE(SUM('GFI German Base power M1'[LN]),TOPN(([Scenario VAR]),'GFI German Base power M1',[LN], ASC))-CALCULATE(SUM('GFI German Base power M1'[LN]),TOPN(([Scenario VAR]-1),'GFI German Base power M1',[LN], ASC))

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors