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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Cyriackpazhe
Helper III
Helper III

Expanded table

Screenshot (29).pngIn this measure, does the expanded table "Winesales" in the second calculate override the effect of context transition. Can someone explain how this works.

 

Also if i replace the second calculate with SumX(Winesales, [Total Sales])* 0.05 . Does it yield the same result.

 

1 ACCEPTED SOLUTION

@Cyriackpazhe 

The expanded table "Winesales" in the second CALCULATE does not overwrite the effect of the context transition. Instead, it ensures that the calculation of [Total Sales] is done over the entire Winesales table, ignoring any filters that might be applied due to the context transition.

Original DAX Expression
CALCULATE(
[No of Sales],
FILTER(
Winesales,
[Total Sales] > CALCULATE([Total Sales], Winesales) * 0.05
)
)

 


Explanation
Context Transition: When CALCULATE is used, it transforms the row context into a filter context. This means that any row context that exists is converted into a filter context, which can affect the calculation of measures.

 

Table Expansion: When you reference a table inside a CALCULATE function, it can expand to include related tables, which can affect the results of the calculation.

 

In the expression CALCULATE([Total Sales], Winesales), the Winesales table is referenced explicitly. This ensures that the calculation of [Total Sales] is done over the entire Winesales table, ignoring any filters that might be applied due to the context transition. This is crucial for calculating the correct threshold value.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
Rupak_bi
Super User
Super User

Hi @Cyriackpazhe 

The attached document explaining to do the calculation step by step by defining variables to make it simple. And this is standard practice. Sumx to be used if you need row by row operation whis is not required here.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

My doubt is does the expanded "Winesales" In second calculate overwrite the effect context transition that happens

@Cyriackpazhe 

The expanded table "Winesales" in the second CALCULATE does not overwrite the effect of the context transition. Instead, it ensures that the calculation of [Total Sales] is done over the entire Winesales table, ignoring any filters that might be applied due to the context transition.

Original DAX Expression
CALCULATE(
[No of Sales],
FILTER(
Winesales,
[Total Sales] > CALCULATE([Total Sales], Winesales) * 0.05
)
)

 


Explanation
Context Transition: When CALCULATE is used, it transforms the row context into a filter context. This means that any row context that exists is converted into a filter context, which can affect the calculation of measures.

 

Table Expansion: When you reference a table inside a CALCULATE function, it can expand to include related tables, which can affect the results of the calculation.

 

In the expression CALCULATE([Total Sales], Winesales), the Winesales table is referenced explicitly. This ensures that the calculation of [Total Sales] is done over the entire Winesales table, ignoring any filters that might be applied due to the context transition. This is crucial for calculating the correct threshold value.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.