This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
I want to check how do I calculate column based on different categories in a row
For eg.
Groups Flow
sb003 159000 GH003 77000
d2004 139000
ch001 156000 No. of days = 10
f4500 200000
I have to write a formula like SB003 + D2004-CH001-F4500-GH003*(NO. OF DAYSINMONTH)
Solved! Go to Solution.
@Anonymous , check the first line
Var _max = maxx(allselected(Dates),Dates[date])
Hi @Anonymous ,
In Edit Query, select your GROUPS column, Pivot it.
Then normally create a DAX:
SB003 + D2004-CH001-F4500-GH003*(NO. OF DAYSINMONTH)
The values above will become your columns and directly use them to add.
If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂
Thanks,
Pragati
@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
This does not seem like the format data is there in power BI
@Anonymous , Try like
measure =
Var _max = maxx(allselected(Date),Date[date])
var _Min= eodate(_max,-1)+1
Var _noDay = datediff(_Min,_max,Day)
return
(calculate(sum(Table[total Value]), Table[group] in {"SB003","D2004"}) - calculate(sum(Table[total Value]), Table[group] in {"CH001","F4500","GH003"}))* _noDay
@amitchandak I think it's still not picking up the variables. it has to do something with Var syntax
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 63 | |
| 53 | |
| 31 | |
| 23 | |
| 23 |