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

Dynamic measure in PowerBI

Depending on the selected year I want to display comparison between CA 2023, CA 2024, budget 2024. 

If I select other year, I want the measure names to change.

I have calculated measures: NS_N = SUM('Table'\[TOT\]), NS_N-1 = CALCULATE(\[NS_N\],SAMEPERIODLASTYEAR(Dim_Calendar\[Date\]))

I want N=selected value who ?

NS vs bug.png

 

2 REPLIES 2
Shivu-2000
Resolver IV
Resolver IV

Hi @nesrinehal20 

 

You can use switch in this case 

 Slicer_Selected = SELECTEDVALUE('') //This will have your columnn used in slicer and help you to catch which year is sleceted

 

 Dynamic Measure= 
	Switch(
		TRUE(),
		[Slicer_Selected]="2023", [measure you want to use],
		[Slicer_Selected]="condition 2", [Another measures],
		[Slicer_Selected]="Condition 3", [Another measure],
		you can have as many conditions you want
		[Default value which you want to display if nothing is selected on slicer]
	)

 

 

I am personally using it in many reports and it works, let me know if any further help is required.

 

 

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

i didn't understand, Slicer_selected is year in my case or what..

 

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.