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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AbdelrahmanAyad
Frequent Visitor

Use The date selected in the page filter to use it as a filter in another query

Hey Guys , I have a requirement and I am somehow new to powerbi. 

I am doing a dashboard for a constructions company. The data model is as below

Img1.png

 

This is how the data in the project progress looks like.

Img2.png

The user selects the As of date in powerbi from a list. 

So I want to check the projects that have status Active at this date and use these project ref to filter all my calculations. I came up with a DAX formula as follow : 
Measure X = CALCULATE(SUM('Approved Variations'[Amount]), FILTER('Approved Variations' , 'Approved Variations'[Project Ref] IN (

VAR M = FILTER('Project Progress', 'Project Progress'[Project Status] <> "Non-Active" && 'Project Progress'[As of Date] = SELECTEDVALUE('Calendar'[Date]))
RETURN SELECTCOLUMNS(M,"Project Ref", 'Project Progress'[Project Ref])

When I use selected values it does not work however if I replaced SelectedValue with a static value like this one : DATE(2017/12/31) It works So any clues or ways to let this work?? 

 

Thank You very much

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @AbdelrahmanAyad,

 

Have you tried my suggestion in an older post? Does it work in your scenario?

 

By the way, do mask sensitive data before uploading, including your personal account.

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.