Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I don´t know if this is possible or if there is another possible solution for this:
Context:
This is how I have it now:
e.g.
Leads_2021 =
VAR a = CALCULATE(DISTINCTCOUNT(Leads[ID_LEAD_SF]),FILTER(Preinscripciones,[EsLead]=1),'Date'[Year]=2021, USERELATIONSHIP('Date'[Date],Leads[F_ORIGEN_LEAD]))
RETURN IF(ISBLANK(a),0,a)
Leads_2022 =
VAR a = CALCULATE(DISTINCTCOUNT(Leads[ID_LEAD_SF]),FILTER(Preinscripciones,[EsLead]=1),'Date'[Year]=2022, USERELATIONSHIP('Date'[Date],Leads[F_ORIGEN_LEAD]))
RETURN IF(ISBLANK(a),0,a)
EsLead =
VAR a = MAX(Leads[F_ORIGEN_LEAD])
RETURN IF(ISBLANK(a),0,1)
I was thinking of putting two slices each one with the year that the person wants to compare, creating a measure with that value, and putting that measure in the measure of the steps.
So instead of the measure "Leads_2021" would be -> "Leads_year1" and "Leads_2022" like ->Leads_year2"
I tried but it doesn't work or maybe I don't know the right way to make it work.
¿How can I create a measure with the value of the year that I selected in one of the two slicers so I can put it in the measure "Leads_year1" =?
Year1 = VALUES('Date'[Year])
Leads_year1 =
VAR a = CALCULATE(DISTINCTCOUNT(Leads[ID_LEAD_SF]),FILTER(Preinscripciones,[EsLead]=1),FILTER('Date','Date'[Year]=[Year1]), USERELATIONSHIP('Date'[Date],Leads[F_ORIGEN_LEAD]))
RETURN IF(ISBLANK(a),0,a)
Thank you in advance.
Solved! Go to Solution.
Hi @Anonymous ,
Nice work!
It looks like you are looking for SELECTEDVALUE( table[column] ).
This function returns the value of the 'column', IF exactle on value is selected in the filter context.
The complete solution could have the following elements:
A. Two tables with years - one for year1 and another for year2. Lets call them 'Years1' and 'Years2', respectively. Each have one column 'Year'.
B. Two slicers: One for each of the tables. Both slicers shoud be configured to enforce single select.
C. Two measures to evaluate which year is selected.
Measure 1 =
IF( HASONEVALUE ( Years1 [Year] ),
Phew, for a moment I was worried. 😉
I'm glad that it works now. 👍
Hi @Anonymous ,
Nice work!
It looks like you are looking for SELECTEDVALUE( table[column] ).
This function returns the value of the 'column', IF exactle on value is selected in the filter context.
The complete solution could have the following elements:
A. Two tables with years - one for year1 and another for year2. Lets call them 'Years1' and 'Years2', respectively. Each have one column 'Year'.
B. Two slicers: One for each of the tables. Both slicers shoud be configured to enforce single select.
C. Two measures to evaluate which year is selected.
Measure 1 =
IF( HASONEVALUE ( Years1 [Year] ),
Thank you for your answer CerebusBI
It seems to work for the overall total 😊, but I don't know why when I put that measure in the matrix it doesn't work for the subcategories 😥.
I don't have any relationship with the two tables that I have created (because I just want the value of the year to filter -> FILTER('Date','Date'[Year]=[Measure 1]), I thought it was that but when I create the relationship the numbers in the matrix are wrong...
Do you think is there something about the relationships?
Kind regards,
Dulce
Sorry, I saw the mistake, it was the "edit interactions"... That I had changed before. But now it works :).
Thank you very much.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |