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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
cn4422
Helper V
Helper V

SPLY as Date for Visual Filter

Hello,

 

I have created the following DAX measure that calculates SPLY for a specific value and that works just fine.

Verarbeitete Anfragen AT SPLY =
VAR dateRange = DATESBETWEEN('Datum'[Date], MIN(Datum[Date]),MAX(Datum[Date]))
Var dateRange2 = Sameperiodlastyear(dateRange)
RETURN
CALCULATE([Summe APF Status LH Verarbeitete Anfragen AT],
ALL('Datum'),
dateRange2
)

 

My question now is, if it is possible to write a DAX measure that can be used as a date-filter for a visual?
So basically the above code, without the calculate part.

 

Or do I somehow have to build this within my date table?

 

Thx in advance for your help! 😊

 

 

 

3 REPLIES 3
ahadkarimi
Solution Specialist
Solution Specialist

Hi @cn4422, create a calculated column, if you encounter any issues, let me know.

IsSPLY = 
VAR dateRange = DATESBETWEEN('Datum'[Date], MIN('Datum'[Date]), MAX('Datum'[Date]))
VAR dateRangeSPLY = SAMEPERIODLASTYEAR(dateRange)
RETURN
IF(
    'Datum'[Date] IN dateRangeSPLY,
    1,
    0
)

 

Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Supplier!

Hi,

@ahadkarimi could you peharps have one more look at my question on how to fix this?

Thank you!

Hi,

thx for your reply!

 

I've created a column:

IsSPLY Spalte =
VAR dateRange = DATESBETWEEN('Datum'[Date], MIN('Datum'[Date]), MAX('Datum'[Date]))
VAR dateRangeSPLY = SAMEPERIODLASTYEAR(dateRange)
RETURN
IF(
    'Datum'[Date] IN dateRangeSPLY,
    1,
    0
)
 

and implemented it as a Filter for a visual (diagram), but the date doesn't change for the visual.

 

Do I have to set the format for the created column to "date"?

Or adjust something else?

 

2024-09-04 13_19_19-APF CRM Report 05_isSPLY.png

 

 

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.