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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
anjanikumar
Helper III
Helper III

Convert this Cognos expressions to Power Bi !!

1    How to create the "Previous month Last date" measure in Power Bi desktop ?

 

2   Fromdate  

 

case
when (?p_DateSelection? = 'DR')
then (?p_FromDate?)
when (?p_DateSelection? = 'PM')
then ([PM Start date])
ELSE ([PreviousDay])
end

 

3     To Date

 

case
when ( ?p_DateSelection? = 'DR')
then (?p_ToDate?)
when ( ?p_DateSelection? = 'PM')
then ([PM End date])
ELSE ([PreviousDay])
end

 

Please convert above 2 and 3 expressions to Power Bi desktop.

 

ThanksinAdvance.

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @anjanikumar 

I don't know much about Cognos' syntax and your business logic.

For "Previous month last date", you can use the EDATE() or EOMONTH() function.

For your question, can you provide us with some sample data and the output you want (in tabular form) so that we can better help you.

 

Best Regards,

Aniya Zhang

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors