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.
I have payment date column and trying to create slicer with between. Bu when I select date from slicer it empties table. any work around?
Solved! Go to Solution.
Hi @annam
My solution is to add missing dates in the source data and fill in the amount as “BLANK”.
In this way, when using a slicer with between, there will be no interval dates that cause visual objects to be empty.
CompleteTable = ADDCOLUMNS(
CROSSJOIN(
CALENDAR(MIN(Payment[Date]), MAX(Payment[Date])),
DISTINCT(Payment[Name])),
"Amount",
COALESCE(LOOKUPVALUE(Payment[Amount],Payment[Date],[Date]), BLANK())
)
Create a one-to-many relationship from table“Payment” to table“CompleteTable” by “Date” columns.
Put “Date”, “Amount” from table“CompleteTable” and “Name” from table“Payment” into the visual object. Put “Date” from table“CompleteTable” into the slicer.
Here is my final test result.
I hope this solution meets your requirements.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @annam
My solution is to add missing dates in the source data and fill in the amount as “BLANK”.
In this way, when using a slicer with between, there will be no interval dates that cause visual objects to be empty.
CompleteTable = ADDCOLUMNS(
CROSSJOIN(
CALENDAR(MIN(Payment[Date]), MAX(Payment[Date])),
DISTINCT(Payment[Name])),
"Amount",
COALESCE(LOOKUPVALUE(Payment[Amount],Payment[Date],[Date]), BLANK())
)
Create a one-to-many relationship from table“Payment” to table“CompleteTable” by “Date” columns.
Put “Date”, “Amount” from table“CompleteTable” and “Name” from table“Payment” into the visual object. Put “Date” from table“CompleteTable” into the slicer.
Here is my final test result.
I hope this solution meets your requirements.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @annam
Why not use a Date Table?
Create an Active One to Many relationship from the Date column in the Date table to the payment date column in your table.
Create a slicer from the Date column in the date table and use the columns from the Data table in a visual that has a measure from your table.
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |