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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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