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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

A measure including two variables from two filters on the same page?

Hello everyone

 

I am trying to caculate the degree of difference across two events, based on which countries users select.

 

How can I create a measure to realize (Value of weeks_out of 11 in Paris, 2018) / (Value of weeks_out of 11 in Bogota, 2017) -1?

 

I guess I need to know how to include two variables from two page level filters on the same page.

 

Thank you in advance! 

 

two_filters.JPG

(P.S. the event can be any two years and may not be consecutive, e.g. 2012 vs. 2016, 2018 vs. 2014)

 

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

 

Please check the following steps.

1# Create a calculated table. There's no relationship between Table and Table 2

Table 2 = DISTINCT('Table'[event])

2# Create slicers with event and event 2.

3# Create measures.

Measure = CALCULATE(SUM('Table'[weeks_out]),FILTER(ALL('Table'),'Table'[event]=SELECTEDVALUE('Table'[event])))

Measure 2 = CALCULATE(SUM('Table'[weeks_out]),FILTER(ALL('Table'),'Table'[event]=SELECTEDVALUE('Table 2'[event])))

compared = [Measure]/[Measure 2]-1

 Result would be shown as below.

3.PNG

4.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

Anonymous
Not applicable

Hi Jay, thanks!

 

If I need to allow users to select more than one option (which is event) here, can I still use "SELECTEDVALUE"?

 

If not, are there any other way to solve this case?

 

Thanks again.

Anonymous
Not applicable

Hi @Anonymous ,

 

Then you can use VALUES() function instead.

Please check the formula below.

 

Measure = CALCULATE(SUM('Table'[weeks_out]),FILTER(ALL('Table'),'Table'[event] in VALUES('Table'[event])))

Measure 2 = CALCULATE(SUM('Table'[weeks_out]),FILTER(ALL('Table'),'Table'[event] in VALUES('Table 2'[event 2])))

 

1.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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

Anonymous
Not applicable

Sorry folks... things are not going well and I did not get what I need yet... 

 

I just draw out my data structure and expect result.

 

Hope those help.

 

data_page1.JPGresult_page2.JPG

Greg_Deckler
Community Champion
Community Champion

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

 

I would create 2 independent slicers that would have underlying different tables. Probably disconnected country tables. Then you could use SELECTEDVALUE to grab the selections. Other than that, hard to be specific with the information provided.



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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.