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
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
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.