Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
@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?
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
@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?
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
@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?
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 35 | |
| 34 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 99 | |
| 73 | |
| 66 | |
| 65 |