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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
moltra
Helper IV
Helper IV

Query from Performance analyzer working in DAX Studio but not in Power BI Report Builder

I copied a query from performance analyzer in power bi and pasted it in query designer in Power Bi Report Builder.  

 

The query works great in Power Bi, DAX Studio, but in Power Bi Report Builder it has a Null value being returned for one value.

 

 

 

 

// DAX Query
DEFINE
  VAR __DS0FilterTable = 
    FILTER(
      KEEPFILTERS(VALUES('Date'[WeekStartDate])),
      AND(
        'Date'[WeekStartDate] >= DATE(2021, 5, 2),
        'Date'[WeekStartDate] < DATE(2021, 6, 28)
      )
    )



  VAR __DS0Core = 
    SUMMARIZECOLUMNS(
      'Date'[WeekStartDate],
      __DS0FilterTable,
      "Variable_1__Weekly_", ('Energy Measures'[Variable 1 (Weekly)],
      "Variable___Weekly_", 'Energy Measures'[Variable 2 (Weekly)]
      
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(1001, __DS0Core, 'Date'[WeekStartDate], 1)

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  'Date'[WeekStartDate]

 

 

 

 

This is the table that is returned in Dax Studio.

 

WeekStartDate

 Variable_1 Variable_2
5/3/2021 12:00:00 AM 22.3630411414053 58.6897356143079
5/10/2021 12:00:00 AM 23.3670150987224 63.2411067193676
5/17/2021 12:00:00 AM 30.0690392843591 63.8531906300485
5/24/2021 12:00:00 AM 17.0206386292835 63.2377049180328
5/31/2021 12:00:00 AM 32.1746588693957 65.5764513491415
6/7/2021 12:00:00 AM 17.52964237904 65.2047913446677
6/14/2021 12:00:00 AM 18.6889657824227 53.2816577129701
6/21/2021 12:00:00 AM 26.6836760355368 64.2135981411817

 

This is how it is returned in Power BI Report Builder

moltra_0-1624988992659.png

Any Help is greatly appreciate.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @moltra ,

 

Have you checked whether the two data models are consistent? Maybe the relationship between the table and the table is inconsistent?

 

 

Best Regards,

Stephen Tao

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @moltra ,

 

Have you checked whether the two data models are consistent? Maybe the relationship between the table and the table is inconsistent?

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors