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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
21818
Frequent Visitor

Custom measure according to slicer selection

Hi, 

 

I have the following measure in Power Bi. 

 

Measure =
VAR_1  = SUMX(DISTINCT(Table1[Col1]),CALCULATE(AVERAGE(Table1[Col2])))
VAR_2 = SUM('Table2'[Col1])
RETURN
CALCULATE(DIVIDE(VAR1,VAR2))
 
A third table is connected to the above tables and I get these calculations for the different values of the Table3. However, now I would like to custom this calculation depending on the selections of a slicer. 
 
Table 3 - Slicer selectionMeasure
Option A,BCalculate using (A,B) in Tables 1,2
Option CCalculate using A values
Option DCalculate using B values
 
I have tried several options to keep current filters and replace C or D values (if selected) with A or B in order to calculate the measure, but none of it worked. 
 
Any ideas? I 've read that dynamically creating tables from slicer is not an option in Power Bi, but not sure it there is any workaround for this.
 
Thanks for your help.
1 REPLY 1
v-xiaotang
Community Support
Community Support

Hi @21818 

not very clear, what does Table 3 look like? and could you share your sample data or sample file after removing sensitive information?

-

any question, please let me know. looking forward to receiving your reply.

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors