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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Edgar_massa
Helper II
Helper II

Context transition

Hello

Good morning everybody

I have a problem here.

The situation is very simple, I have a CNPJ from a company where 2 employees (cousins) work there and provide services to me, each month I compare the contract hour, contract value with what they are issuing in the invoice for me to pay .

I have a table where the contract per employee brings the sum of value and hour etc.. however, in the result of the table, I would like it to only add the contract value/contract hour once, as I add up the hours of the contract with the legal entity, and not the employees of that company

How do I change the context of the calculation to the final result in the table?

 

Edgar_massa_0-1715587031911.png

I need you to bring me the result of 181.87 + 176 and not 715.73

 

5 REPLIES 5
v-shex-msft
Community Support
Community Support

Hi @Edgar_massa,

So you mean you only want to calculate one time per group? According to the snapshot, the current records include two similar results per category.
For this scenario, I'd like to suggest you add an if statement to check the current row contents level, then you can divide 2 if current is calculate on the final result level.

Clever Hierarchy Handling in DAX - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Edgar_massa
Helper II
Helper II

Hi @Edgar_massa,

I already took a look at your file but I can't understand your model yet. You have a huge Dax measure because the way you build your model.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Super User
Super User

Hi @Edgar_massa;

Could you please share a pbix with some data so I can take a look?





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.