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
I have 2 datecolumns G&H, have to write a measure -when H date> G date and H date falls within 12 months from now then value column have to show Region . and viceversa
| G | H | Value |
| 06/07/2016 | 03/22/2021 | Region |
| 05/22/2015 | 06/22/2021 | Region |
| 03/22/2021 | 05/22/2015 | polls |
Solved! Go to Solution.
Hi, @arav007
Please check the following methods.
Value =
IF (
OR ( [H] > [G], [H] IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
"region",
"polls"
)
Measure:
Value M =
IF (
OR ( SELECTEDVALUE('Table'[H]) > SELECTEDVALUE('Table'[G]),
SELECTEDVALUE('Table'[H]) IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
"region",
"polls"
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @arav007
Please check the following methods.
Value =
IF (
OR ( [H] > [G], [H] IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
"region",
"polls"
)
Measure:
Value M =
IF (
OR ( SELECTEDVALUE('Table'[H]) > SELECTEDVALUE('Table'[G]),
SELECTEDVALUE('Table'[H]) IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
"region",
"polls"
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey,
Try this: (DimCalendar is my date table and 'Table' is the table for which it's calculating 'Value').
Value =
IF (
AND (
'Table'[H] > 'Table'[G],
'Table'[H] IN DATESINPERIOD ( DimCalendar[Date], TODAY (), -12, MONTH )
),
"Region",
"polls"
)
If the condition is met 'Region' is returned, if not 'polls'. Is this what you expect?
H>G -Value =region, G>H -value =polls, for both date falls within 12 months from now , like in dateslicer when we are selecting todays date, so in that you can see 1st row H>G so value should reflect "Region"
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 36 | |
| 29 | |
| 28 |
| User | Count |
|---|---|
| 127 | |
| 88 | |
| 78 | |
| 66 | |
| 65 |