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 guys,
I need your help to proceed smoothly in my dashboard please!
I'm creating a new measure to use it inside my dashboard, and I'm calculating a dynamic date to select the count the right values I need.
Please have a look at hte following measure. It works correctly when i select the Date range using manual numbers to set year, month and day.
Result = CALCULATE(DISTINCTCOUNT('CostiRicaviTotale'[IDSpedizioneUnivoco]); ALL('MisurePersonalizzate'[ColonnaKW-1]); Calendario[Data]<=DATE(2021; 1; 31))
But I want to use a dynamic date range, so for example I made the following measure:
YearToUse = YEAR(TODAY())
Now, I want to insert my measure (YearToUse) inside the other measure (Result), to have a dynamic year value.
If I set the following code, I always get an error:
Result = CALCULATE(DISTINCTCOUNT('CostiRicaviTotale'[IDSpedizioneUnivoco]); ALL('MisurePersonalizzate'[ColonnaKW-1]); Calendario[Data]<=DATE(YearToUse; 1; 31))
Any help will be very appreciated, thank you in advance 🙂
Solved! Go to Solution.
You have Created a mesure YeartoUse separately and now you want to include in the measure
Instead of creating a separate mesaure you can create that measure by using Variables
VAR yeartouse = your Measure
and using RETURN syntax
you can use the Variance yeartouse in your final formula
Proud to be a Super User!
You have Created a mesure YeartoUse separately and now you want to include in the measure
Instead of creating a separate mesaure you can create that measure by using Variables
VAR yeartouse = your Measure
and using RETURN syntax
you can use the Variance yeartouse in your final formula
Proud to be a Super User!
Top, got it!
Thank you again!!!
you can use VAR (variable) within the Measure
https://docs.microsoft.com/en-us/power-bi/guidance/dax-variables
Please let me know if any further help required!
Proud to be a Super User!
Hello @VijayP
Thank you for the answer.
I had a look at the link, but I don't understand how can I convert my measure with VAR..
Result = CALCULATE(DISTINCTCOUNT('CostiRicaviTotale'[IDSpedizioneUnivoco]); ALL('MisurePersonalizzate'[ColonnaKW-1]); Calendario[Data]<=DATE(YearToUse; 1; 31))
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 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |