cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
UditJ
Helper II
Helper II

Replicate calculated field from Tableau in power bi

Hello , Below is a calcualted field from Tableau: - 

 

(
(IF [End of Month] >= MAX([Campaign End Date])
THEN MAX([Campaign End Date])
ELSE[End of Month]
END)
-
MIN([Campaign Start Date])
)
/
(MAX([Campaign End Date])-MIN([Campaign Start Date]))

Is there any way i can create the same logic in Power BI ? 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @UditJ ,

 

Try formula like below:

Time Pacing =
DIVIDE (
    IF ( [EOM] >= MAX ( [Campaign End Date] ), MAX ( [Campaign End Date] ), [EOM] ),
    MIN ( [Campaign Start Date] ),
    INT ( MAX ( [Campaign End Date] ) - MIN ( [Campaign Start Date] ) )
)

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @UditJ ,

 

Try formula like below:

Time Pacing =
DIVIDE (
    IF ( [EOM] >= MAX ( [Campaign End Date] ), MAX ( [Campaign End Date] ), [EOM] ),
    MIN ( [Campaign Start Date] ),
    INT ( MAX ( [Campaign End Date] ) - MIN ( [Campaign Start Date] ) )
)

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

amitchandak
Super User
Super User

@UditJ , end of month also need to be a measure in case of meausre

 

Divide(
IF( [End of Month] >= MAX([Campaign End Date])
, MAX([Campaign End Date])
,[End of Month]
END)
-
MIN([Campaign Start Date])
,
int(MAX([Campaign End Date])-MIN([Campaign Start Date])) )

 

 

 

end of month can be

 

eomonth(today(), 0)

 

or

 

eomonth(MAX([Campaign End Date]),0)

Hello AMit , I am gettng synatx issue. Please find the below image: - EOM.PNG
Dont know whats going wrong here. Any suggestions  ? 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors