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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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