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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ronaldbalza2023
Continued Contributor
Continued Contributor

DAX Measure

Hi everyone, could someone translate this into DAX, please. Appreciated the help in advance 🙂

 

Q1, Q2 is based on the selected value of a quarter

 

IF Revenue > Target in Q1

   THEN Revenue Q2 = Revenue

ELSE Revenue < Target in Q1

  THEN Revenue Q2 = Revenue minus Target

 

Attached is the sample data 🙂 https://www.dropbox.com/s/vud41owacppamfw/Sample%20Data.pbix?dl=0 

 

 

1 ACCEPTED SOLUTION
AllisonKennedy
Community Champion
Community Champion

@ronaldbalza2023  If I understand you correctly: 

 

IF Revenue > Target in Q1

   THEN Revenue Q2 = Revenue

ELSE Revenue < Target in Q1

  THEN Revenue Q2 = Revenue minus Target

 

Assuming you have only 1 year selected:

 

Projected Revenue = 

VAR _SelectedQuarter = SELECTEDVALUE(DimDate[Quarter])

RETURN

IF( [Revenue] > [Target] , [Revenue], [Revenue] - [Target] )

 

This will create a measure, so not sure how you want to use this ultimately. Does it need to be cumulative?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

2 REPLIES 2
AllisonKennedy
Community Champion
Community Champion

@ronaldbalza2023  If I understand you correctly: 

 

IF Revenue > Target in Q1

   THEN Revenue Q2 = Revenue

ELSE Revenue < Target in Q1

  THEN Revenue Q2 = Revenue minus Target

 

Assuming you have only 1 year selected:

 

Projected Revenue = 

VAR _SelectedQuarter = SELECTEDVALUE(DimDate[Quarter])

RETURN

IF( [Revenue] > [Target] , [Revenue], [Revenue] - [Target] )

 

This will create a measure, so not sure how you want to use this ultimately. Does it need to be cumulative?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

AllisonKennedy
Community Champion
Community Champion

@ronaldbalza2023  If I understand you correctly: 

 

IF Revenue > Target in Q1

   THEN Revenue Q2 = Revenue

ELSE Revenue < Target in Q1

  THEN Revenue Q2 = Revenue minus Target

 

Assuming you have only 1 year selected:

 

Projected Revenue = 

VAR _SelectedQuarter = SELECTEDVALUE(DimDate[Quarter])

RETURN

IF( [Revenue] > [Target] , [Revenue], [Revenue] - [Target] )

 

This will create a measure, so not sure how you want to use this ultimately. Does it need to be cumulative?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.