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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Arne
Frequent Visitor

Use measure in filter

Hi need to include a measure into a filter to get dynamic calculations. 

I have started to select the period with a slicer which gives my the period in a measure as below

 

Var Sort order period = SELECTEDVALUE(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod])

In this example i choose "202002 Actual" in Var Sort order Period.  

Then i would like to get the period value from  the measure "Var Sort order period"

Into the calculation below 

 

CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SCEBIT");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]=[Var Sort order period]))
/
CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SC50");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]= [Var Sort order period]))

 

which is not working. 

When i typer in the period "202002 actual" in the measure below it works. but i need to change the period from a slicer to get the diagram to react quickly.

 

CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SCEBIT");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]="202002 Actual"))
/
CALCULATE(SUM(ProdUnitAnalyzeScorecardView[Amount]);(ProdUnitAnalyzeScorecardView[Account]="SC50");(ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod]="202002 Actual"))

 

Is there any solution on how to do this?

Br

Arne

 

 

 

 

 

 

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Not following this. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

[Total Amount] = SUM ( ProdUnitAnalyzeScorecardView[Amount] )


[Your Measure] = 
var __sortOrderPeriod = [Var Sort order period]
var __numerator =
	CALCULATE (
	    [Total Amount],
	    ProdUnitAnalyzeScorecardView[Account] = "SCEBIT",
	    ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod] = __sortOrderPeriod
	)
var __denominator =
    CALCULATE (
        [Total Amount],
        ProdUnitAnalyzeScorecardView[Account] = "SC50",
        ProdUnitAnalyzeHyperionDimPeriodView[SortOrderPeriod] = __sortOrderPeriod
    )
var __result = DIVIDE( __numerator, __denominator )
RETURN
	__result

 

I don't know anything about your model but I'd warn you against slicing directly on your fact table by the users. This is dangerous and may produce incorrect results you'll not even be aware of (since the great majority of people do not check their figures well against the source data). If you want to know why you should not do it, then you can search for an article on www.sqlbi.com; just type in the search box: auto-exist.

 

Best

D

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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