Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a table that contains a date, some category fields and a value. The date is essentially a status or state date. The value represents the state on a particular day. My goal is to create a matrix view that compares the data for a start date and end date side by side. I can create the view with a single slicer, but it will allow the users to select more than 2 dates. I have tried numerous concepts, but none have worked for me.
The table structure looks like this:
AsAtDate | Category1 | Category2 | Value |
Date1 | Cat1A | Cat2X | V1 |
Date1 | Cat1A | Cat2y | V2 |
Date1 | Cat1B | Cat2X | V3 |
Date2 | Cat1A | Cat2X | V4 |
Date2 | Cat1B | Cat2X | V5 |
Date2 | Cat1B | Cat2Y | V6 |
Date2 | Cat1C | Cat2Y | V6 |
I have tried numerous ideas I have found in posts, but none work. In particular I have tried creating to lists of dates for the slicers and referening them in a measure using code like:
IF (asatdate = SELECTEDVALUE(startdateslicer,startdefault) || asatdate = SELECTEDVALUE(enddateslicer,enddefault),1,0)
It never seems to get a value for selected value and always goes to the start and end defaults. If I leave the default values out I get a 'blank' result.
Any ideas are appreciated.
@jgretton , In such cases, it always better to use a date table and try measure like
Diff =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = maxx(ALLSELECTED('Date'),'Date'[Date])
return
calculate( sum(Table[value]), filter(Table, Table[Date] =_max)) - calculate( sum(Table[value]), filter(Table, Table[Date] =_min))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
This is a little off of what I am looking for. I have two independent tables that list the available dates, one for the first date and one for the second. I want to filter the table such that I can display the values of the two dates side by side.
I have tried various forms of:
SelectedRows =
IF(
SELECTEDVALUE(firstdate[Date]) = Table[Date]
|| SELECTEDVALUE(seconddate[Date]) = Table[Date],
1,
0
)
If I add a default to the SELECTEDVALUES function calls, the defaults work. However, the functions never seem to recognize the slected values in the slicers. I have also tried versions of the code using HASONEVALUE. and I have tried creating a calculated table that is limited to the two dates. Nothing has worked for me.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |