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

Getting Variance Bettwen 2 Weeks, in selected Slicers

adityo_0-1627897645396.png

Basicaclly i want to created variance using measures, between 2 selected slicers. how can i do this?

example when i type week 22, and week 30

the variance tells the different week 22, and week 30.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@adityo , Try a measure like

 

measure =
Var _Min = MINX(allselected('Date'), 'Date'[WEEK])
Var _Max = MAXX(allselected('Date'), 'Date'[WEEK])
return CALCULATE(SUM(Table1[Value]), filter(Table1, Table1[WEEK]=_max)) -CALCULATE(SUM(Table1[Value]), filter(Table1, Table1[WEEK]=_min))

 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@adityo , Try a measure like

 

measure =
Var _Min = MINX(allselected('Date'), 'Date'[WEEK])
Var _Max = MAXX(allselected('Date'), 'Date'[WEEK])
return CALCULATE(SUM(Table1[Value]), filter(Table1, Table1[WEEK]=_max)) -CALCULATE(SUM(Table1[Value]), filter(Table1, Table1[WEEK]=_min))

 

 

Hi @amitchandak ,

after a little adjustment, this is a magnificent solution, thanks a lot

hi @amitchandak ,

thank you for your response, but it seems doesn't work, what mistakes i do?, here are my screenshots

adityo_1-1627964011220.png

and my measures 

adityo_2-1627964058740.png

actually the difference should tell me

83.907.505 - 83.479.000 = 428.555

 

but it seems don't calculate and

83.907.505 - 83.479.000 =  still 83.907.505

Helpful resources

Announcements
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.