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

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

Reply
tejasruparel
Frequent Visitor

Line chart with dynamic values

Hello,

I have a function: f = a + b + c

Let:

abc
050100
151101
252102
353103
454104
555105
656106
757107
858108
959109
1060110

 

I would like to plot (f vs a) or (f vs b) or (f vs c) on a line chart. Where (f vs a) refers to Axis = a and Values = f

The Axis column is selected using a slicer, so Axis = a or b or c

I have three other what if parameters w/ single value slicers for a (slice_a), b (slice_b) and c (slice_c)

 

So, when Axis = a

measure f0 = 0 + slice_b + slice_c

measure f1 = 1 + slice_b + slice_c

measure f2 = 2 + slice_b + slice_c

:

measure f10 = 10 + slice_b + slice_c

 

Essentially, f = a + b + c, where f is calculated for every a (since Axis = a) and values for b and c are obtained from the single value what if slicers. 

 

I use measures to calculate f0 - f10 since these values need to be dynamic depending on Axis and respective single value slicers.

 

I am able to dynamically change the Axis on my line chart (using unpivot), but how can I plot f values to form a single line using f0-f10?

Is there a way I can combine all my measures (f0 - f10) to create a vector/column that would go in Values on the line chart? 

 

1 ACCEPTED SOLUTION
tejasruparel
Frequent Visitor

4 REPLIES 4
tejasruparel
Frequent Visitor

See attached PBIX

Greg_Deckler
Community Champion
Community Champion

@tejasruparel - I cannot be certain I am following exactly what you are trying to do here. See attached PBIX below signature and see if it is at all close. If not, please explain further. I added an Index column before unpivoting and then wrote this measure:

f = 
    VAR __a = MAXX(FILTER('Unpivoted',[Attribute]="a"),[Value])
    VAR __Index = MAX('Unpivoted'[Index])
    VAR __b = MAXX(FILTER(ALL('Unpivoted'),[Attribute]="b" && [Index] = __Index),[Value])
    VAR __c = MAXX(FILTER(ALL('Unpivoted'),[Attribute]="c" && [Index] = __Index),[Value])
RETURN
    __a + __b + __c

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hey @Greg_Deckler , did you get a chance to look at the PBIX I attached?

 

Hello @Greg_Deckler 

 

Thanks for your response. 

Your approach is partly correct. In your approach f = [150, 153, 156 ... 180] for a = [0, 1, 2, ... 10], but I'm not sure how you are picking values for b and c. 

I want f to be [150, 151, 152 ... 160], so b = 50 and c = 100 (these values should be picked from the single value slicer)

Please see attached PBIX

 

I am essentially trying to plot f as a function of a, then be able to update f based on b and c as selected from single value slicer.

 

Thanks.

 

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.