Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have fair knowledge in Power BI , not able to figure out one piece of puzzle.
I have a simple table below data
Sample Data:
| enddate | status | Brand | Due |
| 11/2/2022 | Failed | Lenova | 1 |
| 12/10/2022 | Failed | Microsoft | 1 |
| 1/22/2023 | Failed | Microsoft | 1 |
| 3/10/2023 | Failed | Microsoft | 1 |
| 3/28/2023 | Complete | Microsoft | 1 |
| 3/30/2023 | Ontrack | Microsoft | 1 |
| 4/10/2023 | Ontrack | Lenova | 1 |
| 4/17/2023 | Risk | Lenova | 1 |
| 5/31/2023 | Risk | Microsoft | 1 |
| 5/30/2023 | Ontrack | HP | 1 |
| 5/10/2023 | Ontrack | Lenova | 1 |
| 11/10/2023 | Risk | Microsoft | 1 |
| 12/10/2023 | InProgress | HP | 1 |
| 1/10/2024 | Risk | Microsoft | 1 |
Expected Result :
Clients wants count of status by Months . (Conditions are)
Please attach pbix file if u can resolve
Solved! Go to Solution.
Here's one approach. You can add a calculated column with the expression below and then use it in your visual (filtering out the two More Than values). You'll also need to work out a sort-by column to get them in your desired order.
MonthForVisual =
VAR thisSOM =
EOMONTH ( 'Status'[enddate], -1 ) + 1
VAR todaySOM =
EOMONTH ( TODAY (), -1 ) + 1
VAR MonthsDiff =
DATEDIFF ( todaySOM, thisSOM, MONTH )
RETURN
SWITCH (
TRUE (),
MonthsDiff < -3, "MT 3 Mos Ago",
MonthsDiff < 0, "Prev 3 Mos",
MonthsDiff < 4, FORMAT ( 'Status'[enddate], "MMM" ),
"MT 3 Mos From Now"
)
Pat
Here's one approach. You can add a calculated column with the expression below and then use it in your visual (filtering out the two More Than values). You'll also need to work out a sort-by column to get them in your desired order.
MonthForVisual =
VAR thisSOM =
EOMONTH ( 'Status'[enddate], -1 ) + 1
VAR todaySOM =
EOMONTH ( TODAY (), -1 ) + 1
VAR MonthsDiff =
DATEDIFF ( todaySOM, thisSOM, MONTH )
RETURN
SWITCH (
TRUE (),
MonthsDiff < -3, "MT 3 Mos Ago",
MonthsDiff < 0, "Prev 3 Mos",
MonthsDiff < 4, FORMAT ( 'Status'[enddate], "MMM" ),
"MT 3 Mos From Now"
)
Pat
Awesome got your solution . it works .
Any simple solution it can be sorted.
@snarasi_83 You'll need to use a disconnected table as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...
@Greg_Deckler I tried but i am not able to figure out the first condition.
Any other option ? or implementation . If solved please upload pbix file
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |