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.
Currently, I am fetching data by using below but it does not work for mobile version of power BI, is theie any good way to bring data for only data of same day last week, that can work in mobile also.
let
#"RetailTransactions-Previous" = let
Source = OData.Feed("https://xxxxxxxxxxxxxxxxxxxx/data", null, [Implementation="2.0"]),
RetailTransactions_table = Source{[Name="RetailTransactions",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(RetailTransactions_table, each Date.IsInPreviousNDays([businessDate], 7)),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each ([TransactionType] = "Sales") and ([TransactionStatus] <> "Voided")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"OperatingUnitNumber", "NetPrice", "TransactionDate"})
in
#"Filtered Rows1",
#"Removed Other Columns" = Table.SelectColumns(#"RetailTransactions-Previous",{"OperatingUnitNumber", "NetPrice", "TransactionDate", "businessDate"}),
#"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"businessDate", Order.Ascending}}),
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each Date.IsInPreviousNDays([businessDate], 6)),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"TransactionDate"})
in
#"Removed Columns"
Solved! Go to Solution.
Hi , @AnwarHabib
Change your m query as below:
let
#"RetailTransactions-Previous" =
let
Source = OData.Feed("https://xxxxxxxxxxxxxxxxxxxx/data", null, [Implementation="2.0"]),
RetailTransactions_table = Source{[Name="RetailTransactions",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(RetailTransactions_table, each Date.IsInPreviousNDays([businessDate], 7)),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each ([TransactionType] = "Sales") and ([TransactionStatus] <> "Voided")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"OperatingUnitNumber", "NetPrice", "TransactionDate"})
in
#"Filtered Rows1",
#"Removed Other Columns" = Table.SelectColumns(#"RetailTransactions-Previous",{"OperatingUnitNumber", "NetPrice", "TransactionDate", "businessDate"}),
#"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"businessDate", Order.Ascending}}),
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each Duration.Days(Date.From(DateTime.LocalNow()) - [businessDate])=7),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"TransactionDate"})
in
#"Removed Columns"
Here is a demo .
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , @AnwarHabib
Change your m query as below:
let
#"RetailTransactions-Previous" =
let
Source = OData.Feed("https://xxxxxxxxxxxxxxxxxxxx/data", null, [Implementation="2.0"]),
RetailTransactions_table = Source{[Name="RetailTransactions",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(RetailTransactions_table, each Date.IsInPreviousNDays([businessDate], 7)),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each ([TransactionType] = "Sales") and ([TransactionStatus] <> "Voided")),
#"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"OperatingUnitNumber", "NetPrice", "TransactionDate"})
in
#"Filtered Rows1",
#"Removed Other Columns" = Table.SelectColumns(#"RetailTransactions-Previous",{"OperatingUnitNumber", "NetPrice", "TransactionDate", "businessDate"}),
#"Sorted Rows" = Table.Sort(#"Removed Other Columns",{{"businessDate", Order.Ascending}}),
#"Filtered Rows" = Table.SelectRows(#"Sorted Rows", each Duration.Days(Date.From(DateTime.LocalNow()) - [businessDate])=7),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"TransactionDate"})
in
#"Removed Columns"
Here is a demo .
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi , @AnwarHabib
Could you please tell me whether your problem has been solved?
If it is, please mark the helpful replies or add your reply as Answered to close this thread?
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm not clear on this one, are you saying that you are writing queries in Power BI Mobile?
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 |
---|---|
108 | |
98 | |
79 | |
66 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |