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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
vivaldii
New Member

How can I compare dates selected from two separate slicers?

Hi,

And I need change percentage also number of changes

vivaldii_1-1710583656123.png

 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @vivaldii ,

 

You need a separate dates table that doesn't have relationship to your fact You can create one in DAX by referencing the original Dates table

Dates2 = Original_Date.

danextian_0-1710645594698.png

 

Please see sample pbix for reference.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @samratpbi , @danextian ,thanks for the quick reply, I'll add more.

Hi @vivaldii ,

The Table data is shown below:

vzhouwenmsft_0-1710831213951.png

Please follow these steps:
1. Use the following DAX expression to create a table named ‘Table2’

Table 2 = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

 2. Use the following DAX expression to create a table named ‘Table3’ 

Table 3 = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

vzhouwenmsft_1-1710831278656.png

3. Use the following DAX expression to create a measure

Measure = CALCULATE( SUMX(FILTER('Table','Table'[Date] = SELECTEDVALUE('Table 2'[Date])),[Number]),ALL('Table 3'[Date]))

4. Use the following DAX expression to create a measure

Measure 2 = CALCULATE( SUMX(FILTER('Table','Table'[Date] = SELECTEDVALUE('Table 3'[Date])),[Number]),ALL('Table 2'[Date]))

5. Use the following DAX expression to create a measure

Measure 3 = [Measure 2] - [Measure]

6. Use the following DAX expression to create a measure

Measure 4 = DIVIDE([Measure 3],[Measure 2])

7. Final output

vzhouwenmsft_2-1710831388853.png

vzhouwenmsft_3-1710831395886.png

 

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

Hi,

Thanks a lot. I tried but, I don't have data like your "Table" example.
I need before date to selected. Not only one month period.

 

<= selected value

 

Measure = CALCULATE( SUMX(FILTER('İlgili Kişi','İlgili Kişi'[Oluşturma Tarihi] <= SELECTEDVALUE('Başlangıç Tarihi'[Date])),[Gönüllü Sayısı Toplam]),ALL('Bitiş Tarihi'[Date]))

 

 

but it doesn't work.

vivaldii_1-1710922314947.png

 

 

danextian
Super User
Super User

Hi @vivaldii ,

 

You need a separate dates table that doesn't have relationship to your fact You can create one in DAX by referencing the original Dates table

Dates2 = Original_Date.

danextian_0-1710645594698.png

 

Please see sample pbix for reference.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

It's works. thanks.

samratpbi
Super User
Super User

You may create 2 different instances of date table and join with your main / fact table. And then put slicer based from those 2 different date tables and also create 2 set of count measures based on 2 date tables.

If this resolves your problem, then please mark it as Solution, thanks!

Hi, it didn't work. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.