cancel
Showing results for 
Search instead for 
Did you mean: 
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


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition
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/



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

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
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors