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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
arav007
Frequent Visitor

power Bi measure

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

GHValue
06/07/201603/22/2021Region
05/22/201506/22/2021Region
03/22/202105/22/2015polls
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @arav007 

 

Please check the following methods.

Value = 
IF (
    OR ( [H] > [G], [H] IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
    "region",
    "polls"
)

vzhangti_0-1659343538436.png

 

Measure:

Value M = 
IF (
    OR ( SELECTEDVALUE('Table'[H]) > SELECTEDVALUE('Table'[G]),
    SELECTEDVALUE('Table'[H]) IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
    "region",
    "polls"
)

vzhangti_1-1659343689500.png

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.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @arav007 

 

Please check the following methods.

Value = 
IF (
    OR ( [H] > [G], [H] IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
    "region",
    "polls"
)

vzhangti_0-1659343538436.png

 

Measure:

Value M = 
IF (
    OR ( SELECTEDVALUE('Table'[H]) > SELECTEDVALUE('Table'[G]),
    SELECTEDVALUE('Table'[H]) IN DATESINPERIOD ( 'Date'[Date], TODAY (), 12, MONTH ) ),
    "region",
    "polls"
)

vzhangti_1-1659343689500.png

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.

Barthel
Solution Sage
Solution Sage

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?

Barthel_1-1658990926208.png

 

 

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"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.