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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Dynamically calculate Measure value based on Slicer Selection

Hi,

My requirement is create measure which calculate distinct count of rows and i have one date column which i need to check with user selected Date slicer.

 

CONTROL PROVIDERS = CALCULATE(DISTINCTCOUNT(NETWORK[Merged Colum]),FILTER(NETWORK,NETWORK[EFFECTIVE_DT]<=SELECTEDVALUE('Date'[Start_Date])))
 
I Created one date table with start date column which has property "After".
 
SO my measure is showing blank values. I dont know why.
2 ACCEPTED SOLUTIONS
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Did you create relationship between date table and the fact table in your scenario? Here I created a sample for your reference.

 

Measure = CALCULATE(DISTINCTCOUNT(NETWORK[Merged Colum]),FILTER('NETWORK','NETWORK'[EFFECTIVE_DT]<=SELECTEDVALUE('Date'[Date])))

 

Capture.PNG

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Create a relationship from the EFFECTIVE_DT column to the Start Date column of the Date Table.  Create a slicer and drag Start Date column from the Date Table.  Select a Date there.  Write these measure

Count = DISTINCTCOUNT(NETWORK[Merged Colum])

CONTROL PROVIDERS = CALCULATE([Count],DATESBETWEEN('Date'[Start_Date],MINX(ALL(Date),'Date'[Start_Date]),MAX('Date'[Start_Date])))

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Create a relationship from the EFFECTIVE_DT column to the Start Date column of the Date Table.  Create a slicer and drag Start Date column from the Date Table.  Select a Date there.  Write these measure

Count = DISTINCTCOUNT(NETWORK[Merged Colum])

CONTROL PROVIDERS = CALCULATE([Count],DATESBETWEEN('Date'[Start_Date],MINX(ALL(Date),'Date'[Start_Date]),MAX('Date'[Start_Date])))

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Did you create relationship between date table and the fact table in your scenario? Here I created a sample for your reference.

 

Measure = CALCULATE(DISTINCTCOUNT(NETWORK[Merged Colum]),FILTER('NETWORK','NETWORK'[EFFECTIVE_DT]<=SELECTEDVALUE('Date'[Date])))

 

Capture.PNG

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.