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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Audrey_ADAPEI35
Frequent Visitor

Use a measure in a segment (variations)

Hello,

 

I have a matrix where I analyse my sales by client with variations between two years. The variations is a measure I created with the functions "SAMEPERIODLASTYEAR". I have as many lines as client. I want to have a segment that make users choose if they want to analyse positive variations or negative variations of sales.

How to make it work?

Audrey_ADAPEI35_0-1717164148217.png

Thank you, I don't know if it's very simple or complicated.

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Audrey_ADAPEI35 

You can create a disconnected table with the segments 

Ritaf1983_0-1717239219751.png

And create a dynamic measure like :

* Delta tested is just a delta between 2 measures like in your scenario.

Delta to show =
SWITCH(SELECTEDVALUE('Positive/Negative'[Segments]),"positive" ,
CALCULATE([delta test],filter('Customers',[delta test]>0)),
SWITCH(SELECTEDVALUE('Positive/Negative'[Segments]),"negative" ,
CALCULATE([delta test],FILTER('Customers',[delta test]<0)),
[delta test]))
 
Now you can use segments from the created table as a slicer.
And the new measure in the matrix +filter the matrix by this measure that should be "not blank".
Ritaf1983_1-1717239480775.png

The pbix is attached.

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

 
 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Audrey_ADAPEI35 

You can create a disconnected table with the segments 

Ritaf1983_0-1717239219751.png

And create a dynamic measure like :

* Delta tested is just a delta between 2 measures like in your scenario.

Delta to show =
SWITCH(SELECTEDVALUE('Positive/Negative'[Segments]),"positive" ,
CALCULATE([delta test],filter('Customers',[delta test]>0)),
SWITCH(SELECTEDVALUE('Positive/Negative'[Segments]),"negative" ,
CALCULATE([delta test],FILTER('Customers',[delta test]<0)),
[delta test]))
 
Now you can use segments from the created table as a slicer.
And the new measure in the matrix +filter the matrix by this measure that should be "not blank".
Ritaf1983_1-1717239480775.png

The pbix is attached.

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

 
 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.

Top Solution Authors
Top Kudoed Authors