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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.