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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Lidou_Cand
Helper III
Helper III

Migration calculated columns to measure

Hello,
I have a weird case on which I would like to have your opinion.
1- I have a tabular model in Azure Analysis Service.
2- I have a Power BI report that sources in my Azure Analysis Service.
3- In the Dataset of the PBI report, users created several calculated columns and calculated measurements.
4- In my team we decided to reassemble these columns calculated in Azure Analysis Service.
5- It was also decided to turn these calculated columns into calculated measures.

What I don't understand is that when I now compare the old report (with columns calculated in the PBI dataset) and the new reports (based on Azure Analysis Service measures) I don't have the same results
I've been annoyed since yesterday because I don't know why there are these contractions.

Can someone explain it to me?

1 ACCEPTED SOLUTION

Hi @Lidou_Cand ,

 

It is really hard to say,the result of calculated column is effected by row context and can't be variable, but the result of measure is effected by row context and filter context,it can be variable.

 

It's hard to tell just by the two formulas you gave us. And in my opinion, these two formulas are somewhat different in allexcept.

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Lidou_Cand - Tough to say, will depend on the calculation. You could have a measures total problem perhaps? Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Lidou_Cand ,Not very clear. the measure is dependent on rows context.

But you can a replicate column like

Column = [Col1]*[Col2] //aggregation - sum

Measure = Sumx( Table, [Col1]*[Col2])

 

If you can share some calculation we can suggest measures

 

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

Hello @amitchandak  and @Greg_Deckler 

 

Thank you for your help.

 

For example, I migrated these 2 calculated columns.

 

1- MOD_DURATION: This column [MOD_DURATION] was a numeric column and I migrated in a Measure like this: SUM([MOD_DURATION])

 

2- Exposure:This column had this expressionDIVIDE(Ptf[Exposure Amt Ptf Ccy],CALCULATE(sum(Ptf[Asset Val]),ALLEXCEPT(Ptf,Ptf[Fund Name (groups)],Ptf[Date])),0)

And I migrated in Analysis Service like this: DIVIDE([Exposure Amt Ptf Ccy],CALCULATE([Asset Val],ALLEXCEPT(Fund,Fund[Fund Name Parent])),0)

 

And I have differents results between PowerBI measures and Analysis Service Measure

 

Hi @Lidou_Cand ,

 

It is really hard to say,the result of calculated column is effected by row context and can't be variable, but the result of measure is effected by row context and filter context,it can be variable.

 

It's hard to tell just by the two formulas you gave us. And in my opinion, these two formulas are somewhat different in allexcept.

 

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

 

Best Regards,

Dedmon Dai

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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