Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello!
I have a problem and here it is:
In my Power Bi I have a table with report which is getting data from local folder. A key is date, which is adding as a column on every refresh. It looks like this:
I already have a measure which counts number of devices by date, it seems like
DevicesByDate = CALCULATE(COUNTROWS('Table');DISTINCT('Table'[Date]))But I can`t get a measure which will substract number of DevicesByDate from previous date (Example: 4 devices by 08/15/2017-4 devices by 07/21/2017 = 0).
Can you please help me guys?
Thanks!
Solved! Go to Solution.
Hi @trotsale
Try out this method. This method grabs the device ids from last month and subtracts them from device ids this month.
DevicesByDate difference last month compared to this month = CALCULATE(COUNTROWS('Test');DISTINCT('Test'[Date]);DATEADD(DATESBETWEEN(Test[Date];STARTOFMONTH(Test[Date]);ENDOFMONTH(Test[Date]));-1;MONTH)) - CALCULATE(COUNTROWS('Test');DISTINCT('Test'[Date]);DATESINPERIOD(Test[Date];LASTDATE(Test[Date]);-1;MONTH))
Best,
Martin
Hi @trotsale
Try out this method. This method grabs the device ids from last month and subtracts them from device ids this month.
DevicesByDate difference last month compared to this month = CALCULATE(COUNTROWS('Test');DISTINCT('Test'[Date]);DATEADD(DATESBETWEEN(Test[Date];STARTOFMONTH(Test[Date]);ENDOFMONTH(Test[Date]));-1;MONTH)) - CALCULATE(COUNTROWS('Test');DISTINCT('Test'[Date]);DATESINPERIOD(Test[Date];LASTDATE(Test[Date]);-1;MONTH))
Best,
Martin
Thank you so much for help!
It works now, but it displays uptake only when graphic is shown by quarter or year. When I choose display by month, It shows me number of devices. Maybe I should change dates period?By year
By month
I`ve tried this and here is what i got:
Here is the way I used DAX:
My DateTable consists of 2 dates (07/21/2017 and 08/14/2017). Am I doing something wrong?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 42 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |