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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
michael_knight
Post Prodigy
Post Prodigy

Measure Formula changes depending on Slicer option

Hi,

 

I'm trying to create a measure which will change the formula depending on who is selected on the Slicer

 

We have multiple agents that get a different % of the Margin. In the example below I have two agents and a measure for each agent with the Margin % they get. I want to have one measure which will change depending on who is selected in the slicer

 

Agent.PNG

John gets 1% and Tom gets 3%. I want to consolidate this into one measure

 

I've currently got the Agents in a different table as it's part of a Star Scheme in the main report, as well as a date table which as inactive relationships as I use the USERELATIONSHIP function in my measures.

 

Does anyone know how I can do this?

 

PBIX: https://www.dropbox.com/s/4pbc79tpo9yg59a/help.pbix?dl=0

 

Thanks,

Mike

1 ACCEPTED SOLUTION
MrSujay
Resolver II
Resolver II

Create a new table that will store margin values for each agent.


MrSujay_0-1627925443096.png

Check and de-activate the relation between Agents and margin.

MrSujay_2-1627925767078.png

Create new measure 

 

New Margin % = (AVERAGE(margin[margin]))/100 * [Margin Measure] 

 

Now if you don't select any agent then it will select average margin.

Now create a new slicer from Agent from the margin table.
Output for John : 

MrSujay_3-1627926443914.png

Output for Tom :

MrSujay_4-1627926492046.png
Thank you.

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

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




 

 

 

View solution in original post

5 REPLIES 5
MrSujay
Resolver II
Resolver II

Create a new table that will store margin values for each agent.


MrSujay_0-1627925443096.png

Check and de-activate the relation between Agents and margin.

MrSujay_2-1627925767078.png

Create new measure 

 

New Margin % = (AVERAGE(margin[margin]))/100 * [Margin Measure] 

 

Now if you don't select any agent then it will select average margin.

Now create a new slicer from Agent from the margin table.
Output for John : 

MrSujay_3-1627926443914.png

Output for Tom :

MrSujay_4-1627926492046.png
Thank you.

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

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




 

 

 

Thank you @MrSujay 

michael_knight
Post Prodigy
Post Prodigy

Hi,

 

Still looking to solve this issue. If anyone has any suggestions please let me know

 

Thanks

MrSujay
Resolver II
Resolver II

Please provide what is your expected output? what output your are expecting from new measure ?

My expected outcome is a single measure with a formula that changes depending on who is selected on the slicer

 

Currently there is two measures:

 

John Margin % = (1/100) * [Margin Measure] 

 

 

Tom Margin % = (3/100) * [Margin Measure] 

 

And I want them to be consolidated into one measure 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.