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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
iblock
Frequent Visitor

In Force Policy Slicer

data pic.png

I am using the map visual and want to display policies that are in force as of a specified YYYYMM.  I want to create a slicer such that when the date is selected, it will plot only the policies that satisfy: Eff YYYYMM <= Selected Date <= Exp YYYYMM.

 

Could anyone help with this?

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @iblock 

You can refer to the following example

Sample data 

vxinruzhumsft_0-1677820949375.png

 

Date table

vxinruzhumsft_1-1677820973332.png

Create a measure

IsInDate = var _format=CONVERT(FORMAT(MAX('Date'[Date]),"YYYYMM"),INTEGER)
return IF(ISFILTERED('Date'[Date]),IF(MAX([Eff YYYYMM])<=_format&&MAX([Exp YYYYMM])>=_format,1,0),1)

Then put the measure to the visual filter of Policy Slicer

vxinruzhumsft_4-1677821198067.png

 

 

Output

vxinruzhumsft_5-1677821228719.png

 

vxinruzhumsft_6-1677821248006.png

 

Best Regards!

Yolo Zhu

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-xinruzhu-msft
Community Support
Community Support

Hi @iblock 

You can refer to the following example

Sample data 

vxinruzhumsft_0-1677820949375.png

 

Date table

vxinruzhumsft_1-1677820973332.png

Create a measure

IsInDate = var _format=CONVERT(FORMAT(MAX('Date'[Date]),"YYYYMM"),INTEGER)
return IF(ISFILTERED('Date'[Date]),IF(MAX([Eff YYYYMM])<=_format&&MAX([Exp YYYYMM])>=_format,1,0),1)

Then put the measure to the visual filter of Policy Slicer

vxinruzhumsft_4-1677821198067.png

 

 

Output

vxinruzhumsft_5-1677821228719.png

 

vxinruzhumsft_6-1677821248006.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

iblock
Frequent Visitor

I created a parameter called "Inforce Date" and a new column in the data that is calcualted as: 

Inforce? = IF(AND(Premium_Raw[Eff YYYYMM]<=[Inforce Date],Premium_Raw[Exp YYYYMM]>=[Inforce Date]),"Inforce","Not Inforce")
 
However, the result is coming back "Not Inforce" for every row, which is not correct.
iblock
Frequent Visitor

Another Update: I believe the reason why it's not working properly may be because I need to establish a relationship between the two tables, however, I have not been able to sort out what the relationship should be.  Thoughts?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.