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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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