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
bcmoulam
New Member

Ratio Calculation between two user-selected columns

Hi all, 

Ref example table below. Various numeric metrics for each month - there are about 30 total columns similar to the examples (events, defects etc.)

 

Dateeventsdefectsdelayscyclesdefects/cycles
Jan-22111923224310.038
Feb-2211785921620.039
Mar-2240743323560.031
Apr-2260733828200.026
May-22122891323200.038
Jun-2292714021400.033
Jul-2241912126170.035
Aug-22106733028300.026
Sep-2253632429680.021
Oct-2238601729060.021
Nov-2214862620550.030
Dec-22110602828870.021
Jan-23130624025130.025
Feb-23132902621980.041
Mar-23117992926550.037
Apr-2339853920180.042
May-2366842829470.029
Jun-23141952223130.041
Jul-2362821525810.032

 

I'd like to calculate ratio's between the columns based on user-input - I'm imagining two filters titled Numerator & Denominator. The two filter values are passed to a Measure(?) that then calculates the ratio for each row. In the above example the user would have selected 'defects' in the Numerator filter and 'cycles' in the Denominator filter. That result is then plotted in a line chart over time.

 

bcmoulam_0-1675212488077.png

 

I know I can create loads of calculated columns to do this up-front for all the possible combinations, but was wondering if possible to do this dynamically based on user input?

 

I've looked at other similar articles but they don't quite fit what I'm after - any help appreciated. 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@bcmoulam , This is the old measure slicer way, You have to create two such tables and slicer and then create combined measure using a divide

 

How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M

View solution in original post

2 REPLIES 2
bcmoulam
New Member

Perfect, thanks Amit!

amitchandak
Super User
Super User

@bcmoulam , This is the old measure slicer way, You have to create two such tables and slicer and then create combined measure using a divide

 

How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M

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.