March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have a table something like this
Value | Datetime (date)
2 12/12/2016
3 12/12/2016
2 12/12/2016
2 12/12/2016
4 12/12/2016
2 12/14/2016
What I want to do is to create a measure where I get a distinct count of the "value" datafield, based on the "Date" column where the date column is NOW - 1 month.
How do I acheive this?
Solved! Go to Solution.
Hi @ToNo87
create measure like
Distinctcount M-1 = CALCULATE(DISTINCTCOUNT(Table1[Value]);DATEADD(Table1[Date];-1;MONTH))
Regrds.
Pavel
Hi @ToNo87
create measure like
Distinctcount M-1 = CALCULATE(DISTINCTCOUNT(Table1[Value]);DATEADD(Table1[Date];-1;MONTH))
Regrds.
Pavel
I'm getting a warning that says "The syntax for ';' is incorrect. " (I am using Power BI Desktop). 🙂
It works fine. Maybe that when you have edited the formula you have also removed some bracket or something.
Regards.
Pavel
Thanks @PavelR
This is the error message I got:
The syntax for ';' is incorrect. (DAX(CALCULATE(DISTINCTCOUNT(Data[Value]);DATEADD(Data[Time];-1;MONTH)))).
this is the measure I added:
Distinctcount -1 = CALCULATE(DISTINCTCOUNT(Data[Value]);DATEADD(Data[Time];-1;MONTH))
Note that Data[Value] is hash id (text) and Data[Time] is date/time if that matters.
It worked, thanks!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
83 | |
77 | |
66 | |
57 |
User | Count |
---|---|
132 | |
113 | |
98 | |
78 | |
78 |