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 All
I am attaching a sample screenshot for the task that I am trying to achieve in power bi
The image has both the input and expected output type
Please look and let me know if anyone can help
Solved! Go to Solution.
Hi @Anonymous ,
Total =
SWITCH (
MAX ( 'Table (2)'[Category] ),
"Count A", COUNT ( 'Table'[Col A] ),
"Sum B", SUM ( 'Table'[Col B] )
)
Previous Month =
SWITCH (
MAX ( 'Table (2)'[Category] ),
"Count A",
CALCULATE (
COUNT ( 'Table'[Col A] ),
FILTER ( 'Table', DATEDIFF ( 'Table'[DATE], TODAY (), MONTH ) = 0 )
),
"Sum B",
CALCULATE (
SUM ( 'Table'[Col B] ),
FILTER ( 'Table', DATEDIFF ( 'Table'[DATE], TODAY (), MONTH ) = 0 )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Total =
SWITCH (
MAX ( 'Table (2)'[Category] ),
"Count A", COUNT ( 'Table'[Col A] ),
"Sum B", SUM ( 'Table'[Col B] )
)
Previous Month =
SWITCH (
MAX ( 'Table (2)'[Category] ),
"Count A",
CALCULATE (
COUNT ( 'Table'[Col A] ),
FILTER ( 'Table', DATEDIFF ( 'Table'[DATE], TODAY (), MONTH ) = 0 )
),
"Sum B",
CALCULATE (
SUM ( 'Table'[Col B] ),
FILTER ( 'Table', DATEDIFF ( 'Table'[DATE], TODAY (), MONTH ) = 0 )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks Stephen
@Anonymous , have tried time intelligence with date table
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
diff = [MTD Sales]-[last MTD Sales]
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
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 |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |