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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I seem to be creating lots and lots of simple measures along the lines of:
_total_of_this = CALCULATE(COUNT('The Table'[Something]),VALUE('The Table'[Something]) > 0)
across more than 30 fields to get totals for bar graphs. I was wondering if there's a more efficient way to do this, other than multiple measures that differ only in the column they work on?
Also, I prefix them with _ so they bubble to the top and keep separate from fields as there doesn't appear to be way to organise anything in power bi desktop. I've used powershell to create them in the past but that no longer works in 2.79.5768.721.
thanks,
Alistair
Solved! Go to Solution.
Hi @codebrane ,
Do you mean that you wanna combine multiple measures into less measures?
If so ,are these measures applied to the same column or the same value?In this case,you can use switch() function,such as
MEASURE= SWITCH(SELECETEDVALUE(COLUMN 1),"A",[measure 1],"B","measure 2"...).
Here is a sample .pbix you can refer to.
BUT if you wanna find the measures more easier, you can create a measure table with no filed inside,then move the measures to the table one by one.
Select the measure>go to the menu bar>move the measure to the measure table.
Hi @codebrane ,
Do you mean that you wanna combine multiple measures into less measures?
If so ,are these measures applied to the same column or the same value?In this case,you can use switch() function,such as
MEASURE= SWITCH(SELECETEDVALUE(COLUMN 1),"A",[measure 1],"B","measure 2"...).
Here is a sample .pbix you can refer to.
BUT if you wanna find the measures more easier, you can create a measure table with no filed inside,then move the measures to the table one by one.
Select the measure>go to the menu bar>move the measure to the measure table.
sorry, forgot to say, some of the data has 0-10, some has letters and some has true/false, all on the same bar graph. So could have:
_total = CALCULATE(COUNT('The Table'[Gender]),FORMAT('The Table'[Gender], "") = "M")
as well as 0-10 etc
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |