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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
L_G
Frequent Visitor

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
Frequent Visitor

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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