The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I am new in dax.
Problem: I have a table which have 3 columns (ID,TYPE,DATE). ID+TYPE is unique combination.
I create running total measure:
CALCULATE(
DistinctCountID,
FILTER(
ALLSELECTED(DATE,
ISONORAFTER(DATE, MAX(DATE), DESC)
)
)
The result of the CHART IS:
But I would like to see this:
How can I rewrite the query to be able to see the redline at least a straight, if there will be no data for red TYPE in the last DATE in the chart?
(BTW: I can't create another simple table, because the ID is used in model for filtering)
Thank you in advance.
Solved! Go to Solution.
@LiborK , You shoudl use a date table, marked as date table joined with you date of table
CALCULATE(
Distinctcount(Table[ID]) ,
FILTER(
ALLSELECTED('Date') , 'Date'[Date] <= Max('Date'[Date])
)
)
Rolling Days Formula: https://youtu.be/cJVj5nhkKBw
Hi, @LiborK
You can try the following methods.
Sample data:
Measure =
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),[Date]<=SELECTEDVALUE('Table'[Date])))
Is this similar to the output you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, thank you for your answer. I tried your query, bud the result is different:
The data look like this example:
@LiborK , You shoudl use a date table, marked as date table joined with you date of table
CALCULATE(
Distinctcount(Table[ID]) ,
FILTER(
ALLSELECTED('Date') , 'Date'[Date] <= Max('Date'[Date])
)
)
Rolling Days Formula: https://youtu.be/cJVj5nhkKBw
Thank you, you were right.
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |