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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
saurabhpore
Frequent Visitor

Constant value for denominator using measure

Hello All,

 

I am working with data set where I have youth_ID, start_date, end_date, region (table with duplicate youth_id). I have sliclers for start_date, end_date, region. Now, I want to create card where if user select a particular region for particular date range the card should display percent of youth in that region based on the total count of that time range.

 

eg. I have total 1035 unique youth's in dataset. If I select particular date range for a region deominator should remain constant (eg. theer are 25 unique youth's after Jan 1, 2021) and numberator will change as per the selections.

 

I calutated numerator and denominator using below formula:

numCALCULATE(DISTINCTCOUNT('part-2_YA_engagement'[youth_id]))

denCALCULATE(DISTINCTCOUNT('part-2_YA_engagement'[youth_id]),ALL('part-2_YA_engagement'[region]))

per = num/den

 

I above approch my denominator changes as I select different regions.

 

Please advice on how Can I do this calculations.

5 REPLIES 5
amitchandak
Super User
Super User

@saurabhpore , Try like

 

numCALCULATE(DISTINCTCOUNT('part-2_YA_engagement'[youth_id]))

denCALCULATE(DISTINCTCOUNT('part-2_YA_engagement'[youth_id]),ALL('part-2_YA_engagement'))

per = num/den

hello,

 

I tried that approach but it gives me total unique youths rather than unique  youth count for selected slicers. 

@saurabhpore ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. with couple of use case

@amitchandak please let me know if you find any solution. 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors