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
L_G
Helper I
Helper I

Dynamic difference between two selected field parameter measures

Hi,

I need help writing a DAX measure in which I have to calculate the difference between two selected measure in a field paramenter slicer.

Do I have to create a calculation group in Tabular Editor? If yes, can you guide me on how to do it?

es. Selecting EBITDA for the current year and the EBITDA of the previous year from the filter parameter slicer, I need to have the difference between theese two selected measure.

 

L_G_0-1697532159999.png

 

L_G_1-1697532184072.png

 

I Need to have this difference measure to be dynamic, based on the selected measere in the field paramenter slicer.

 

Can anyone help me??

 

Thanks in advance,

Luca

3 REPLIES 3
klaman
Regular Visitor

I solved it by creating two measures that shows the selected value order from the field parameters: 

 

Parameter 1 = SELECTEDVALUE('Parameter1' [order])

Parameter 2 = SELECTEDVALUE('Parameter2' [order])

 

Then I created a Switch measure that looks a the above chosen values and their order: 

 

Difference = 

SWITCH(
    TRUE(),
    [Parameter1] = 6 && [Parameter2] = 0, [Selected measure for parameter 1] - [Selected measure for parameter 2],
    [Parameter1] = 5 && [Parameter2] = 1, [Selected measure for parameter 1] - [Selected measure for parameter 2]
  etc)
L_G
Helper I
Helper I

HI @some_bih 

I need to have a dinamyc measure that appears only if I select those 2 measures in the field parameter slicer.

In the field parameter slicer I have multiple measures that don't need this "Difference AC - AP" measure to be showed.

some_bih
Super User
Super User

Hi @L_G simple measure like below is ok for you?

Difference test= [EBTDA]-[EBTDAP]





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






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.