Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I posted this in Desktop but figured this might be a better place.
I want to try out a new ratio for my area (Number of A x Months of the period/...) and, while I have the logic for the formula, I don't know how to get the time frame selected in the slicer. My idea is that the time would be selected here:
The number of months in the time range selected would go into the measure, this is a ratio that's getting a color depending on the ratio value, but it has to be adjusted to the time frame.
Any ideas on how to get it done or what is my best option?
TIA
@Anonymous , You can have measure like this give diff between dates
Measure =
var _min = minx(Allselected(Date), Date[Date])
var _max = maxx(Allselected(Date), Date[Date])
return
datediff(_min, _max , Month())
For conditional formatting, you can color measure like the example. Use this "Field value" option
Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK('Table'[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))
color =
switch ( true(),
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"lightgreen",
// Add more conditions
"red"
)
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
User | Count |
---|---|
42 | |
28 | |
24 | |
20 | |
16 |
User | Count |
---|---|
54 | |
35 | |
18 | |
18 | |
15 |