Join 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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Dear Community,
You could know the answer to this question.
I need a card to display which product exceeds forecasted sales based on the date it happened.
Below you can see the calculations made to get the first date when either of products exceeds demand. (this works)
The issue is that:
1. product names are colums
2. there are more products C, D, E etc.(which are out of scope) and either Product A or B needs to show up
Many thanks in advance!
Kind regards
Solved! Go to Solution.
Hi @queryuser ,
I create some example data to show your problems. And i used the following code which you can refer it in the pbix which in the end.
Card 1 sales exceeds forecasted =
VAR _A =
SUMMARIZE( ALL( 'sales' ), [Product], "SUMP", SUM( sales[Sales] ) )
VAR _B =
ADDCOLUMNS(
_A,
"IF", IF( [SUMP] >= SELECTEDVALUE( forecast[forecasted sales] ), 1, BLANK() )
)
RETURN
CALCULATE( MIN( 'sales'[date] ), FILTER( _B, [IF] = 1 ) )
Result:
If you need more help please share some example data.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @queryuser ,
I create some example data to show your problems. And i used the following code which you can refer it in the pbix which in the end.
Card 1 sales exceeds forecasted =
VAR _A =
SUMMARIZE( ALL( 'sales' ), [Product], "SUMP", SUM( sales[Sales] ) )
VAR _B =
ADDCOLUMNS(
_A,
"IF", IF( [SUMP] >= SELECTEDVALUE( forecast[forecasted sales] ), 1, BLANK() )
)
RETURN
CALCULATE( MIN( 'sales'[date] ), FILTER( _B, [IF] = 1 ) )
Result:
If you need more help please share some example data.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi _ chenwu zhu,
Thank you for your reply. The difference is that the table in Power BI is as displayed.
Prod A / Prod B as columns - in your .pbix the 'Sales' is in one culmn
How would you combined those columns into 1 ?
Hi @queryuser ,
You mean you want to change multiply colums to one column?
---->>>
You can use unpiovt columns function ( in power query editor).
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services.
User | Count |
---|---|
11 | |
9 | |
6 | |
5 | |
4 |