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
asdf1608
Helper V
Helper V

Window_stdev table(across) along with date in power BI

I am trying to convert tableau dashboard to poewr BI. I am facing an isssue in converting a calculated column called window_stdev.

The formula in tableau is : 

WINDOW_STDEV(SUM([Quantity 2])).

asdf1608_0-1700743801594.png

It seems to be calculating table across specific dimension by date

asdf1608_1-1700743931955.png

The result from tableau is

asdf1608_2-1700744026876.png

The formula I used in power BI  : 

Rolling Stdev =
VAR CurrentRowDate = aa[Date]
VAR RowsToInclude =
    FILTER(
        ALL(aa),
        aa[Date] >= (CurrentRowDate - 2) && aa[Date] <= CurrentRowDate
    )
RETURN
IF(
    COUNTROWS(RowsToInclude) > 1,
    STDEVX.P(RowsToInclude, aa[Quantity2]),
    BLANK()
) // this is not giving me correct answer.
 
The above formula is not giving me the answer same as tableau
The result from power BI is
asdf1608_3-1700744135076.png

I am attaching the excel file and poewr BI file

sample.XLSX

Sample.pbix

 

Help in this is really needed.

 

Thanks in advance

7 REPLIES 7
lbendlin
Super User
Super User

Your sample table "aa"  has 213K rows, but only 18K distinct rows.  What are all these duplicates?

 

Are you sure you want to calculate the standard deviation across three values only?  That will be statistically useless.

@lbendlin 

certain id may repeat. I need the standard deviations for the window across date.

normal standard deviation is coming in power BI. But for the windows it is giving me an wrong answer

Where is this filter 

 FILTER(
        ALL(aa),
        aa[Date] >= (CurrentRowDate - 2) && aa[Date] <= CurrentRowDate
    )
in Tableau?  From your example WINDOW_STDEV calculates across all dates for each ID.

@lbendlin There are no filters. As you said WINDOW_STDEV calculates across all dates for each ID.

I just used the above DAX. It might be wrong.

That's why I raised this. 
I am not sure why to create DAx so that the values matches with Tableau

How do you know the Tableau values are correct?

@lbendlin 

I am not sure if the tableau result is correct. All I want is the formula conversion.

Window_stdev to be calculated across the specified dimension

WINDOW_STDEV(SUM([Quantity 2])).

asdf1608_0-1702461933307.png

 

It seems to be calculating table across specific dimension by date

asdf1608_1-1702461933656.png

 

Please help me in this

 

Thanks in advance

@lbendlin 

I am not sure if the tableau result is correct. All I want is the formula conversion.

Window_stdev to be calculated across the specified dimension

WINDOW_STDEV(SUM([Quantity 2])).

asdf1608_0-1702461933307.png

 

It seems to be calculating table across specific dimension by date

asdf1608_1-1702461933656.png

 

Please help me in this

 

Thanks in advance

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.