Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
You can put a visual or page level filter for >0 and simply drag the column on visual and change aggregation to count
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
107 | |
70 | |
70 | |
43 |
User | Count |
---|---|
148 | |
106 | |
104 | |
89 | |
65 |