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.
5 days ago in Power BI by anonymous
• 130 points
35 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)

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 4 days ago by Priyanka

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
• 17,060 points
41 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
• 45,780 points
99 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
• 45,780 points
64 views
0 votes
1 answer

How do I format the KPI in Power BI

format the KPI by selecting the paint ...READ MORE

answered Oct 9, 2018 in Power BI by Kalgi
• 45,780 points
70 views
0 votes
0 answers

DAX Calculations for dynamically changing value

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

5 days ago in Power BI by anonymous
• 17,060 points
16 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 3, 2018 in Data Analytics by Ali
• 10,440 points
213 views
+1 vote
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
• 56,960 points
4,311 views
0 votes
7 answers
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 in Power BI by Avantika
• 1,500 points
331 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
• 45,780 points
297 views