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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors