Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
I have a table as specified in the below screenshot. I'm trying to calculate total unique days in the date range.
In this example, expect output is 30
How can we do it in DAX? This calculation needs to happen dynamically and the result will be used in remaining calculations. Hence PowerQuery solution is not suitable.
Solved! Go to Solution.
Hi @nandukrishnavs
This shall give you the desired result at the total level or in a card visual. Please refer to attached sample file.
unique days =
COUNTROWS (
DISTINCT (
SELECTCOLUMNS (
GENERATE (
'Table',
CALENDAR ( 'Table'[start date], 'Table'[end date] )
),
"@Days", [Date]
)
)
)
Hi @nandukrishnavs
This shall give you the desired result at the total level or in a card visual. Please refer to attached sample file.
unique days =
COUNTROWS (
DISTINCT (
SELECTCOLUMNS (
GENERATE (
'Table',
CALENDAR ( 'Table'[start date], 'Table'[end date] )
),
"@Days", [Date]
)
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |