Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi everyone,
I have a requirement from my client to compare in the same table data from a date selected from slicer and the first day of the year. I can't get correct data.
Sample data:
| date_load | ID |
| 01/01/2017 | ID1 |
| 01/01/2017 | ID2 |
| 01/01/2017 | ID3 |
| 01/01/2017 | ID4 |
| 01/06/2017 | ID1 |
| 01/06/2017 | ID2 |
| 01/06/2017 | ID3 |
| 01/09/2017 | ID1 |
| 01/09/2017 | ID2 |
| 31/12/2017 | ID1 |
| 01/01/2018 | ID1 |
| 01/01/2018 | ID7 |
and two measures:
Start Year = CALCULATE(COUNTROWS(Table1);FILTER(Table1;Year(SELECTEDVALUE(Table1[date_load])) = YEar(Table1[date_load])))
Current = COUNTROWS(Table1)
I need to show for 1/1/2017
Start Year = 4
Current =4
and for 31/12/2017
Start Year = 4
Current =1
but get
Start Year = 1
Current =1
Thank you in advance
Solved! Go to Solution.
Try this MEASURE
Start Year =
CALCULATE (
COUNTROWS ( Table1 ),
FILTER (
ALL ( Table1 ),
Table1[date_load] = DATE ( YEAR ( SELECTEDVALUE ( Table1[date_load] ) ), 1, 1 )
)
)
Try this MEASURE
Start Year =
CALCULATE (
COUNTROWS ( Table1 ),
FILTER (
ALL ( Table1 ),
Table1[date_load] = DATE ( YEAR ( SELECTEDVALUE ( Table1[date_load] ) ), 1, 1 )
)
)
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 73 | |
| 70 | |
| 39 | |
| 34 | |
| 23 |