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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
strangerMike
Helper II
Helper II

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

 

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

@strangerMike,

 

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-436...
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quickstart-learn-dax-basics/

 

Regards,

Charlie Liao

View solution in original post

2 REPLIES 2
v-caliao-msft
Employee
Employee

@strangerMike,

 

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-436...
https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quickstart-learn-dax-basics/

 

Regards,

Charlie Liao

thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.