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.
Hi all,
I'm trying to create a measure, but I can not figurate out how.
I have a table where I have a start and end date and some other information, and I have a graph that shows all the temperatures for the year, I would like when a date is choosen the graph shows only the information from the start to end time.
The relation between the tables is ID.
Date Start | Date End | Name | Total Time (h) | ID |
01/01/2005 14.25 | 01/01/2005 15.25 | AAA | 1 | 1 |
02/01/2005 14.25 | 02/01/2005 15.25 | BBB | 1 | 1 |
Date | Temperature | ID |
01/01/2005 13.25 | 25,00 | 1 |
01/01/2005 13.30 | 25,10 | 1 |
01/01/2005 14.00 | 25,02 | 1 |
01/01/2005 14.15 | 24,9 | 1 |
01/01/2005 14.30 | 25,02 | 1 |
01/01/2005 14.45 | 25,01 | 1 |
Thanks!
Solved! Go to Solution.
Hi @Yal ,
You need to add the following measures:
Temperature Calculation =
VAR Start_Value =
MIN ( Periods[Date Start] )
VAR End_Value =
MAX ( Periods[Date End] )
RETURN
SUMX (
FILTER (
SUMMARIZE ( 'Details'; Details[Date]; Details[Temperature] );
'Details'[Date] >= Start_Value
&& 'Details'[Date] <= End_Value
);
'Details'[Temperature]
)
Now setup your chart with the date from the Details table and this measure and add a slicer based on the periods table.
As you can see in the attach file everything works properly, just for the sake of comparision I have made the following changes to your data:
Please be aware that this solution will give you all the values between the periods so if you select 2 non consecutive periods all of the periods in between will also be choosen in the visualization.
Check PBIX file attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Yal ,
You need to add the following measures:
Temperature Calculation =
VAR Start_Value =
MIN ( Periods[Date Start] )
VAR End_Value =
MAX ( Periods[Date End] )
RETURN
SUMX (
FILTER (
SUMMARIZE ( 'Details'; Details[Date]; Details[Temperature] );
'Details'[Date] >= Start_Value
&& 'Details'[Date] <= End_Value
);
'Details'[Temperature]
)
Now setup your chart with the date from the Details table and this measure and add a slicer based on the periods table.
As you can see in the attach file everything works properly, just for the sake of comparision I have made the following changes to your data:
Please be aware that this solution will give you all the values between the periods so if you select 2 non consecutive periods all of the periods in between will also be choosen in the visualization.
Check PBIX file attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
106 | |
104 | |
77 | |
68 | |
61 |
User | Count |
---|---|
148 | |
107 | |
107 | |
83 | |
70 |