I HAVE 2 REQUIREMENT PLEASE HELP IN POWER BI

+1 vote
2 requirements: please help below scenarios

I HAVE A "DATETIME " FIELD, SO HOW TO CREATE A  Dax calculation.

1) Lasthour      2) Today    3) yeterday  4) lat 5 day  5) laST 30 DAYS

i have "Value " field in  how to create DAX CALCULATION

aVERAGE, maX, MIN, CURRENT\LASTVALUE  in power BI dynamically change in a report.
Dec 3, 2019 in Power BI by anonymous
• 390 points
2,173 views
So you have a table with columns as - Lasthour, Today, Yesterday, last 5 day and last 30 day with the values of average, max, min, current/lastvalue and these values keep changing?
I have 2 fields Datetime and Value

Datetime                           Value

12/1/2019 12:00:04           136

12/1/2019 01:30:05            200        

12/1/2019  02:00:02          120

12/2/2019  03:30:09         100  ..ETC

i have 2 requiremrnt:

 1) based on Datetime field-----I need creating hours, weeks,days THEN  LaST hour, tODAY,yestERDAY,last 5 DAYS, last 30 DAYS, LAST 1 WEEKS, LAsT 2 weeks how TO create a dax calculation. (select what ever data last 5 days or last 2 weeks or last 1 hour change report)

2) based on Value fileld------- i need  creating  Average, MIn, MAx,current/last value, total   how to create a dax calculation  (this is for a create slicer when ever create a average then change report dynamically)

please help.
I didn't understand your second requirement.
FOR EXAMPLE

X- AXIs  Is "DATETIME"

Y-AXIs Is "VALUE"   IN ONE REPORT   

so, My requirement is User select creating Average,min,maX,Current/lastvalue  it Is automatically showing report dynamically.( LIKE single slicer)
Date:                              Value

12/25/2019 04:45:20      20

12/25/2019 05:35:10      10

how to calculate below dax calculations in power bi

This hour

Last hour

Last 3 hours

Yesterday

please help this calculation.

Hi, @Vnk,

Regarding your above query, you can go through this https://www.edureka.co/community/72681/dax-calculations-on-date-time

1 answer to this question.

0 votes

you have a table with data time and values. 

Now to fetch values for the last hour, you can use the hour(datatime) function which will give you an hour value from 0-23. And last hour is basically (hour -1)

lasthour = table[value("12/1/2019, 12:00:04")]

to fetch values for today you can use the function today()

today = table[value(today())]

yesterday is basically (today-1)

yesterday = table[value(today()-1)]

last 5 days is the sum of today, today-1, today-2, today-3, today-4

last5days = table[value(today)+value(today()-1)+value(today()-2)+value(today()-3)+value(today()-4)]

For your second requirement, there are straight of functions

Average = average([value])

Min = min([value])

Max = max([value])

Create different columns for Average, Min and Max the go ahead and create a slicer in the usual manner and use these(average, min, and max) as your filters.

answered Dec 3, 2019 by Priyanka
HE IS ASKING FOR A DYNAMIC MEASURE

Related Questions In Power BI

0 votes
1 answer

How Do I Find Power BI users that have signed in

If you are a tenant admin, and ...READ MORE

answered Oct 15, 2018 in Power BI by Hannah
• 18,540 points
1,437 views
0 votes
1 answer

I have a web API with basic authorisation and username and password. How do i connect to it in Power BI?

Hey, @There, I found your query is quite ...READ MORE

answered Oct 29, 2020 in Power BI by Gitika
• 65,890 points
3,468 views
0 votes
1 answer

Can I create a Power BI report in Office 365 without my locally installed Office Excel?

Yess!! You can achieve this by using ...READ MORE

answered Sep 26, 2018 in Power BI by Kalgi
• 52,360 points
866 views
0 votes
1 answer

What are the components I need to excel to become a pro in power BI

Having knowledge about these topics is a must.  Power ...READ MORE

answered Oct 8, 2018 in Power BI by Kalgi
• 52,360 points
820 views
0 votes
0 answers

DAX Calculations for dynamically changing value

2 requirements: please help below scenarios I HAVE ...READ MORE

Dec 3, 2019 in Power BI by anonymous
• 18,540 points
948 views
0 votes
0 answers

How to work on existing power query using python

Hi I have an existing power query created ...READ MORE

Feb 7, 2020 in Power BI by Biswajith
• 120 points
2,781 views
0 votes
2 answers

What is difference between Distributed search head and Search head cluster?

 A distributed environment describes the separation of ...READ MORE

answered Dec 4, 2018 in Data Analytics by Ali
• 11,360 points
2,400 views
+2 votes
3 answers

Problem with installation of Wordcloud in anaconda

Using Anaconda Python 3.6 version For Windows ...READ MORE

answered Aug 7, 2018 in Data Analytics by Priyaj
• 58,100 points
18,601 views
0 votes
1 answer

How do I use Python scripts in Power BI?

Hi, You can create interactive reports out of ...READ MORE

answered May 2, 2019 in Power BI by Avantika
• 1,520 points
2,379 views
0 votes
1 answer

Power BI DAX expression more than 2 or conditon

Heyyy @Hannah, you just need remove or ([principlecode] = ...READ MORE

answered Oct 29, 2018 in Power BI by Kalgi
• 52,360 points
3,056 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP