Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello
I try to figure out to do one simple thing and I would greatly appreciate any help.
I have a table like this :
| Calendrier.[DATE] | Calendrier.[Duration] |
| dd/mm/YYYY | 7 |
| dd/mm/YYYY | 7,5 |
| dd/mm/YYYY | 8 |
| dd/mm/YYYY | 7,5 |
| ... | ... |
I would like to count the number of lines where the value equals 7,5 and the total number of lines.
Thank you for your help
Solved! Go to Solution.
Thank you so much for your solution.
Makes me want to quickly improve my skills with powerBI.
Total Lines = COUNTROWS(Calendrier)
7,5 lines = CALCULATE ( COUNTROWS(Calendrier), KEEPFILTERS(Calendrier[Duration] = 7,5 ) )
Hello thank you for your help.
The first formula works fine but the second doesn't, because I wasn't precise enough, I'm sorry.
My table is built like this :
- a date --> a duration
- a date --> a duration
- a date --> à duration
Sometimes, the date is the same (i can have several recording for, let's say, 2020/04/01 and I printed the total sum of the duration for this date).
That means i summed up several recordings to obtain this result.
| Calendrier.[DATE] | Calendrier.[Duration] |
| dd/mm/YYYY | 7 |
| dd/mm/YYYY | 7,5 |
| dd/mm/YYYY | 8 |
| dd/mm/YYYY | 7,5 |
| ... | ... |
Now I would like to have the number of lines where the sum of the duration, for each day, equals 7,5.
I really hope my explanations were clear enough.
Best regards
Thank you so much for your solution.
Makes me want to quickly improve my skills with powerBI.
In my example I have a measure called [DurationSum]
DurationSum = SUM ( Calendrier[Duration] )
Then this measure will count the rows where DurationSum = 7,5
7,5 count =
COUNTROWS (
FILTER (
ADDCOLUMNS ( VALUES ( Calendrier[Date] ), "x", [DurationSum] ),
[x] = 7,5
)
)
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |