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

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.

Reply
Anonymous
Not applicable

Help with visual that is based on a typ of filter?

Hello, I am trying to create a visual with a yes or no option.

Lets say I have table with rows of subscriptions.

In one of the columns theres a date with when the subscription last was used. I want to use a visual with yes/no option that when yes is applied only the rows/subscriptions that either have their date-cell empty or are older than 365 days are listed. 

 

I have managed to do this with a measurement that looks like this with the option of YES/NO in a separate table. but I cant use it on other visuals besides the table. 

 

ShowMeasure =
IF (
    "Nej" IN DISTINCT (Inaktiva_val[Val]),
    1,
    IF (SELECTEDVALUE (sub_info[Inaktiv ab]) = "Inaktiv", 1, 0)
)
 
And the measure that marks the subscriptions as inactive (empty or 365 days or older) I then made a column with this measurement in it. 
Inaktiv =
VAR _LastDate = MAX('sub_info'[Senast aktiv]) + 0
VAR _CutoffDays = 365
VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)
RETURN
IF(_DaysSinceLastUsed > _CutoffDays, "Inaktiv")

 

This only works in the table. I also have a bar chart that I want to use this one so that I can count the types of subscriptions when the option yes/no is used.

 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous 

You can create a table 

e.g 

vxinruzhumsft_0-1677117521504.png

 

Then put it to a slicer. then create a measure.

e.g 

Inaktiv =
VAR _LastDate = MAX('sub_info'[Senast aktiv]) + 0
VAR _CutoffDays = 365
VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)
RETURN
IF(ISFILTERED('Table'[Type])=FALSE(),...,
IF(MAX('Table'[Type])="Yes",IF(_DaysSinceLastUsed > _CutoffDays, "Inaktiv")))

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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.