Forum Discussion
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
| G | H | Value |
| 06/07/2016 | 03/22/2021 | Region |
| 05/22/2015 | 06/22/2021 | Region |
| 03/22/2021 | 05/22/2015 | polls |
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.
3 Replies
- v-zhangtiCommunity Support
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.
- BarthelSolution 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?- arav007Frequent Visitor
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"