The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Team,
I hope this email finds you well.
I need assistance with writing a Measure calculation in Power BI that involves two conditions. Although I have mentioned the two conditions correctly in the attached ScreenShot and tried to create the formula based on them, it is not working as expected..
Here are the details:
- I am using a slicer for Date filter, and the dates are available in the "Date_Table" table.
- The measure should calculate the output based on the selected date filter values.
Please refer to the attached ScreenShot for the exact conditions and the expected result. Your help in providing the correct formula for this measure would be greatly appreciated.
Thank you for your support.
Best regards,
Afrath
Solved! Go to Solution.
Hi @AFRATH34
Before write a measure, you need to change the format of "New_date1" and "New_date2" to the date type.
Then try the following measure:
MEASURE =
IF (
SELECTEDVALUE ( 'All'[New_Date1] )
< SELECTEDVALUE ( Date_Table[SelectedMonthEnd] )
&& SELECTEDVALUE ( 'All'[New_Date1] )
> SELECTEDVALUE ( Date_Table[SelectedMonthStart] ),
SELECTEDVALUE ( 'All'[Upfront Gross Profit] )
* SELECTEDVALUE ( 'All'[IG Forecast TCGP] ),
BLANK ()
)
Measure2 =
IF (
SELECTEDVALUE ( 'All'[New_Date2] )
< SELECTEDVALUE ( Date_Table[SelectedMonthEnd] )
&& SELECTEDVALUE ( 'All'[Expiry Date] )
>= SELECTEDVALUE ( Date_Table[SelectedMonthStart] ),
SELECTEDVALUE ( 'All'[Recurring Gross Profit per Period] )
* SELECTEDVALUE ( 'All'[IG Forecast TCGP] ),
BLANK ()
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AFRATH34
Before write a measure, you need to change the format of "New_date1" and "New_date2" to the date type.
Then try the following measure:
MEASURE =
IF (
SELECTEDVALUE ( 'All'[New_Date1] )
< SELECTEDVALUE ( Date_Table[SelectedMonthEnd] )
&& SELECTEDVALUE ( 'All'[New_Date1] )
> SELECTEDVALUE ( Date_Table[SelectedMonthStart] ),
SELECTEDVALUE ( 'All'[Upfront Gross Profit] )
* SELECTEDVALUE ( 'All'[IG Forecast TCGP] ),
BLANK ()
)
Measure2 =
IF (
SELECTEDVALUE ( 'All'[New_Date2] )
< SELECTEDVALUE ( Date_Table[SelectedMonthEnd] )
&& SELECTEDVALUE ( 'All'[Expiry Date] )
>= SELECTEDVALUE ( Date_Table[SelectedMonthStart] ),
SELECTEDVALUE ( 'All'[Recurring Gross Profit per Period] )
* SELECTEDVALUE ( 'All'[IG Forecast TCGP] ),
BLANK ()
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@AFRATH34 can you share the pbix file? or instead paste formulas and data so that we can make copy and paste.
Thx,
BBF
Hi @BeaBF ,
Could you please explain how I can attach the PBIX file?
Thank you for your assistance.
Best regards,
Afrath
Hi @BeaBF ,
Please find the link to the file: [https://drive.google.com/drive/folders/1fl52xaMFfa5lRMOzGqfwy_MQdbal3tAu ].
I need your support in creating a measure column. I have not created the measure yet and would appreciate your assistance. The desired output for the "J0D8" Opp ID was mentioned in an earlier screenshot.
Here are the conditions for the measure:
Thank you for your support.
Best regards,
Afrath
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |