The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Power Users,
Is there a way in DAX to have a calculation/formula on each rows? I have a few categories and I wanted to calculate each rows based on the categories given. Say on revenue category I have DAX which is sum of all sales. Debtor days, I have another dax measure, and goes on and on. I know its easy to use it in excel because we can have a different formula on each rows. Is there any way to do it in power bi? Thanks!
@rbalza , You can have.
Like
Measure =
Switch(true() ,
max(Table[Category]) = "SRevenue" , Sum(Table[val1]) ,
max(Table[Category]) = "WIP Days" , Sum(Table[val2]) ,
Sum(Table[val3])
)
or
Measure =
Sumx(Table,
Switch(true() ,
(Table[Category]) = "SRevenue" , (Table[val1]) ,
(Table[Category]) = "WIP Days" , (Table[val2]) ,
(Table[val3])
))
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
5 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |