Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
I have 1 Fact table and 1 Date table. I would like 2 new metrics.
Earliest week of =
Latest week of =
Both metrics should be based on the orders in the Fact table, not the Date table. I'm still learning.
Thanks
Solved! Go to Solution.
Try these measures:
Earliest Week Of =
VAR vMinFactDate =
CALCULATE ( MIN ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMinFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResult
Latest Week Of =
VAR vMaxFactDate =
CALCULATE ( MAX ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMaxFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResult
Proud to be a Super User!
Try these measures:
Earliest Week Of =
VAR vMinFactDate =
CALCULATE ( MIN ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMinFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResult
Latest Week Of =
VAR vMaxFactDate =
CALCULATE ( MAX ( 'FACT'[DATE] ), ALL ( 'FACT' ) )
VAR vTable =
FILTER ( ALL ( 'DATE' ), 'DATE'[DATE] = vMaxFactDate )
VAR vResult =
MAXX ( vTable, 'DATE'[WEEK OF] )
RETURN
vResult
Proud to be a Super User!
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
79 | |
72 | |
71 | |
54 | |
51 |
User | Count |
---|---|
45 | |
38 | |
33 | |
31 | |
28 |