Forum Discussion
Power BI coming from SAS
Hello, i have some previous SAS experience but I am trying to learn more about power BI. My report in SAS has a lot of formulas and I am trying to figure out what is the best means of translating SAS to Power BI. Here is an example...
Curr Mo Curr Yr = IF ( Max [_ByGroup_] ('Flag Bounce Rate %'n) > 0 )
RETURN ( ( ( Sum [_ForAll_] ('# of bounces (curr mo curr yr)'n) / Sum [_ForAll_] ('# emails sent (curr mo curr yr)'n) ) * 100 ) Round 1 )
ELSE (
IF ( Max [_ByGroup_] ('Flag Open Rate %'n) > 0 )
RETURN ( ( ( Sum [_ForAll_] ('# emails opened (curr mo curr yr)'n) / Sum [_ForAll_] ('# emails sent (curr mo curr yr)'n) ) * 100 ) Round 1 )
ELSE (
IF ( Max [_ByGroup_] ('Flag Click Thru Rate %'n) > 0 )
RETURN ( ( ( Sum [_ForAll_] ('# of Clicks - Total (curr mo curr yr)'n) / Sum [_ForAll_] ('# emails sent (curr mo curr yr)'n) ) * 100 ) Round 1 )
ELSE Sum [_ByGroup_] ('Metric (curr mo curr yr)'n) ) )
Where can I go to get Power Bi translations. Like: 'ByGroup', etc.
I am even having difficulty just trying to pull Today's date (without time), everything i have been trying as one error or another.
Like Today = Date(now()) or Today = Now(year, month, day) ...etc. Cant hit the nail on the head!
Thanks
In Power BI, we use DAX or Power query to build our data model. Such as we can get current date by using DAX function
CurrentDate= TODAY()So in your scenario, if you need to translate your formulas, you'd better learn some DAX function first, here are some useful links for you reference.
https://support.office.com/en-us/article/QuickStart-Learn-DAX-Basics-in-30-Minutes-51744643-c2a5-436a-bdf6-c895762bec1a?ui=en-US&rs=en-US&ad=US
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quickstart-learn-dax-basics/Regards,
Charlie Liao
2 Replies
- v-caliao-msft
Microsoft Employee
In Power BI, we use DAX or Power query to build our data model. Such as we can get current date by using DAX function
CurrentDate= TODAY()So in your scenario, if you need to translate your formulas, you'd better learn some DAX function first, here are some useful links for you reference.
https://support.office.com/en-us/article/QuickStart-Learn-DAX-Basics-in-30-Minutes-51744643-c2a5-436a-bdf6-c895762bec1a?ui=en-US&rs=en-US&ad=US
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quickstart-learn-dax-basics/Regards,
Charlie Liao
- strangerMike
Helper II
thank you